Search found 52 matches
- Tue Sep 04, 2018 4:59 pm
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
Re: TF2 - Getting weapon names from event byte
I suppose that works. I would've liked to see that be a bit more dynamic than that but if that's what sourcemod is doing then thats prob fine. Is there a clean namespace we could use to integrate this directly into the SourcePython? Theres a handful of other TF2 related data that would be helpful t...
- Tue Sep 04, 2018 3:33 pm
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
Re: TF2 - Getting weapon names from event byte
Seems like this is the enumerated type (untested): # ============================================================================ # >> IMPORTS # ============================================================================ # Python from enum import IntEnum # Source.Python Imports from events import ...
- Tue Sep 04, 2018 12:44 am
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
Re: TF2 - Getting weapon names from event byte
Yeah im not sure why player shoot does not trigger. I was gonna ask about that lol. Im assuming there is just some offset not set right? This is the code im currently testing with from entities.entity import Entity from weapons.entity import Weapon @Event("player_hurt") def damage(event): ...
- Mon Sep 03, 2018 6:43 pm
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
Re: TF2 - Getting weapon names from event byte
The byte is probably the index of the entity: weapon = Weapon(ev['weapon']) Ah yeah that was a good thought as well; but did not work. It looks like it's refering to this here: https://wiki.alliedmods.net/Team_Fortress_2_Item_Definition_Indexes It doesnt appear to be an entity index...
- Sun Sep 02, 2018 9:40 pm
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
Re: TF2 - Getting weapon names from event byte
Hmm that is a good thought! however it wouldn't be entirely accurate to do it that way unfortunately Some classes like demo can det his stickies with any weapon equipped. Or projectile weapons can kill while the equipped weapon is switched off before it hits. Not to mention sentry guns, bleed, jarat...
- Sun Sep 02, 2018 4:35 pm
- Forum: Plugin Development Support
- Topic: TF2 - Getting weapon names from event byte
- Replies: 10
- Views: 8041
TF2 - Getting weapon names from event byte
Hello! Some events return a 'byte' that represents the weapon used by a player. Example: http://wiki.sourcepython.com/developing/events/tf.html#player-shoot I would like to get the string representation of that weapon (i.e. tf_weapon_scattergun). I know this changes with every update (what few of th...
- Mon Jun 18, 2018 7:40 pm
- Forum: Plugin Development Support
- Topic: Is it possible to control the spectate camera?
- Replies: 11
- Views: 7504
Re: Is it possible to control the spectate camera?
I think what i'm looking to do is create my own version of the autodirector feature of sourcetv.
Something that those watching the game and shoutcasting can watch.
Something that those watching the game and shoutcasting can watch.
- Mon Jun 18, 2018 4:49 pm
- Forum: Plugin Development Support
- Topic: Is it possible to control the spectate camera?
- Replies: 11
- Views: 7504
Is it possible to control the spectate camera?
wondering if i'm able to manipulate the spectate camera, move it, have it look at an entity and set properties like FOV
im guessing that the spec camera is an entity i could find within the game and mess with it there?
im guessing that the spec camera is an entity i could find within the game and mess with it there?
- Tue Apr 24, 2018 3:21 pm
- Forum: Plugin Development Support
- Topic: SourceTV Listener
- Replies: 22
- Views: 14417
Re: SourceTV Listener
theres this in sourcemod: https://github.com/demostf/plugin
- Thu Apr 19, 2018 8:02 pm
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Re: Adding a prefix to chat
Not sure; I can test that tonight. I do have a sorucemod plugin that is controlling bots and having them occasionally drop lines in chat. Maybe one of those plugins are causing an issue?
Though it seems to happen randomly and i don't know how to replicate the issue.
Though it seems to happen randomly and i don't know how to replicate the issue.
- Wed Apr 18, 2018 9:40 pm
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Re: Adding a prefix to chat
What's the output of "sp info"? IMPORTANT: Please copy the full output. -------------------------------------------------------- Checksum : 32dec6fa49b2fd255c92735c8b764986 Date : 2018-04-18 21:39:54.491542 OS : Linux-4.13.0-1012-gcp-x86_64-with-debian-stretch-sid Game : tf2 SP version : ...
- Wed Apr 18, 2018 3:39 am
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Re: Adding a prefix to chat
So hooking that function; this keeps happening to me maybe every few hours: [SP] Caught an Exception: Traceback (most recent call last): File "../addons/source-python/packages/source-python/messages/hooks.py", line 204, in _pre_user_message_begin tmp_recipients = make_object(Ba...
- Mon Apr 16, 2018 11:35 pm
- Forum: Plugin Development Support
- Topic: Cross plugin events
- Replies: 10
- Views: 6399
Re: Cross plugin events
What is the conceptual difference between the listener module and registering an event, and why one vs the other? As far as "why", the only reason to use a custom event over a listener is if you want to have access in SM or another server plugin. That's the only reason I haven't changed G...
- Mon Apr 16, 2018 10:09 pm
- Forum: Plugin Development Support
- Topic: Cross plugin events
- Replies: 10
- Views: 6399
Re: Cross plugin events
There is this: http://wiki.sourcepython.com/developing/module_tutorials/events.html?highlight=events I would only use that if something outside of Source.Python (e. g. Sourcemod plugins) need to listen to those events. If you want to share notifications across Source.Python plugins or libraries, I ...
- Mon Apr 16, 2018 7:40 pm
- Forum: Plugin Development Support
- Topic: Cross plugin events
- Replies: 10
- Views: 6399
- Mon Apr 16, 2018 7:33 pm
- Forum: General Discussion
- Topic: Download only bz2 files without checking for the orig.
- Replies: 6
- Views: 5973
Re: Download only bz2 files without checking for the orig.
When it checks the vtf / vmt files; is it doing some kind of hash compairison, and can the server publish those hashes that the client can consume?
- Sun Apr 15, 2018 6:39 pm
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Re: Adding a prefix to chat
Ah yes, you are right. @HookUserMessage("SayText2") def on_say(recpient, message_data): if message_data['index'] == 0: return True rank = f"{GOLD}Admin{WHITE} |" sender = Player(message_data['index']) if message_data['message'] == &...
- Sun Apr 15, 2018 3:17 pm
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Re: Adding a prefix to chat
Nice! That does work much better: @HookUserMessage("SayText2") def on_say(recpient, message_data): if message_data['index'] == 0: return True sender = Player(message_data['index']) rank = f"{WHITE}[{GOLD}Admin{WHITE}]" message_data['mes...
- Sat Apr 14, 2018 10:55 pm
- Forum: Plugin Development Support
- Topic: Adding a prefix to chat
- Replies: 9
- Views: 5884
Adding a prefix to chat
I've seen a number of things in SP that might allow this; but im a little lost on how they work I was able to get it to work with this: @SayFilter def _say_filter(command, index, team_only): if index is 0: pass else: msg = ' '.join(command) sender = Player(index) SayT...
- Tue Apr 03, 2018 2:14 pm
- Forum: Plugin Development Support
- Topic: print player name function
- Replies: 3
- Views: 3126
Re: print player name function
from events import Event from messages import SayText2 from players.entity import Player @Event('player_death') def on_player_death(game_event): userid = game_event['userid'] attacker = game_event['attacker'] victim = Player.from_userid(userid) killer...