Search found 190 matches
- Sat Sep 05, 2020 3:17 pm
- Forum: Plugin Development Support
- Topic: Information for hooks
- Replies: 6
- Views: 4114
Information for hooks
In l4d2 I am trying to hook damage dealt to the 'infected' enemies. @EntityPreHook(EntityCondition.is_not_player, 'on_take_damage') def infected_pre_take_damage(stack_data): print("Non-player took damage") victim = make_object(Entity, stack_data[0]) ...
- Sun Jun 03, 2018 7:08 am
- Forum: Plugin Development Support
- Topic: Preventing death event take_damage
- Replies: 6
- Views: 6020
Re: Preventing death event take_damage
I'm not finding it possible to modify players' health who are not contained in the pointer argument. Attempts to use player.take_damage even with skip_hooks=True also always results in a crash. @SayCommand('test') def test(command, index, teamOnly): message(Player(ind...
- Wed May 30, 2018 6:57 am
- Forum: Plugin Development Support
- Topic: No max function...?
- Replies: 2
- Views: 3255
No max function...?
[SP] Caught an Exception: Traceback (most recent call last): File "..\addons\source-python\plugins\rpgo\rpgo.py", line 619, in _pre_take_damage lifesteal = max(1, damage * (attacker.getLevel() * .01)) UnboundLocalError: local variable 'max' referenced before assignment Last section under ...
- Tue May 29, 2018 2:08 am
- Forum: Plugin Development Support
- Topic: Unexpected behavior from pickle.dump
- Replies: 8
- Views: 6790
Re: Unexpected behavior from pickle.dump
I did find the issue. super().__init__() had little effect. The issue was trying to override missing properties of the object. This works fine. def __getattr__(self, attr): # Redirect to __getitem__ # Can also use: # return self[attr] try: return self[attr] except KeyError: raise AttributeEr...
- Tue May 29, 2018 1:42 am
- Forum: Plugin Development Support
- Topic: Unexpected behavior from pickle.dump
- Replies: 8
- Views: 6790
Re: Unexpected behavior from pickle.dump
Yeah I still have no idea whats causing this. [SP] Unloading plugin 'rpgo'... [('__class__', <class 'rpgo.rpgo._PlayerList'>), ('__contains__', <built-in method __contains__ of _PlayerList object at 0x02D164C8>), ('__delattr__', <method-wrapper '__delattr__' of _PlayerList object at 0x02D164C8>), ('...
- Thu May 24, 2018 3:48 am
- Forum: Plugin Development Support
- Topic: Unexpected behavior from pickle.dump
- Replies: 8
- Views: 6790
Re: Unexpected behavior from pickle.dump
class PlayerData(dict): def __init__(self): self.kills = 0 self.spree = 0 self.gold = 0 self.rpgClass = messages['default class'] self.cooldown = False self.stunTimer = None self.speedTimer = None self.baseSpeed = 1.0 self.pounces = 0 for eachClass in CLASSES: self['%s...
- Wed May 23, 2018 6:03 am
- Forum: Plugin Development Support
- Topic: Unexpected behavior from pickle.dump
- Replies: 8
- Views: 6790
Unexpected behavior from pickle.dump
sp plugin reload rpgo [SP] Unloading plugin 'rpgo'... D:\csgo\csgo/addons/source-python/plugins/rpgo/player_database.db <_io.BufferedWriter name=Path('D:\\csgo\\csgo/addons/source-python/plugins/rpgo/player_database.db')> <built-in function dump> WARNING: __getstate__ ADDED AS A DATABASE ATTRIBUTE ...
- Wed May 23, 2018 4:14 am
- Forum: Plugin Development Support
- Topic: Preventing death event take_damage
- Replies: 6
- Views: 6020
Re: Preventing death event take_damage
I couldn't help but notice there wasn't a way to access the victim in this case...?
E: OK so on this post you can
viewtopic.php?f=20&t=1468&p=11709&hilit=on_take_damage#p11709
How can you find out what is returned in stack_data?
E: OK so on this post you can
viewtopic.php?f=20&t=1468&p=11709&hilit=on_take_damage#p11709
How can you find out what is returned in stack_data?
- Tue May 22, 2018 3:23 am
- Forum: Plugin Development Support
- Topic: Preventing death event take_damage
- Replies: 6
- Views: 6020
Re: Preventing death event take_damage
How would I get that information from an event prehook?
- Tue May 22, 2018 2:29 am
- Forum: Plugin Development Support
- Topic: Preventing death event take_damage
- Replies: 6
- Views: 6020
Preventing death event take_damage
When using take_damage it will cause two death notifications and fire player_death twice, once for each weapon. How do I prevent that? https://i.imgur.com/95kHPDS.png I wouldn't mind preHooking on_take_damage and modifying damage, but I do not know how to access the attacker's information. The only ...
- Mon May 21, 2018 1:06 am
- Forum: Plugin Development Support
- Topic: Move player behind another
- Replies: 2
- Views: 2828
Re: Move player behind another
My solution. If anyone has suggestions I'd like to hear them! @SayCommand('test') def test(command, index, teamOnly): player = Player(index) message(player.origin) target = player.get_view_player() if target: angles = target.get_view_angle() an...
- Mon May 21, 2018 12:24 am
- Forum: Plugin Development Support
- Topic: Move player behind another
- Replies: 2
- Views: 2828
Move player behind another
My vector math isn't the best :P I want to be able to position a player behind another. This code would have worked, except for the player clipping on enemy players :\ @SayCommand('test') def test(command, index, teamOnly): player = Player(index) if player.get_view_pl...
- Wed May 16, 2018 8:43 pm
- Forum: Plugin Development Support
- Topic: Accessing properties of parent in subclass
- Replies: 3
- Views: 3487
Re: Accessing properties of parent in subclass
from players.entity import Player class rpgPlayer(Player): def __init__(self, index): ''' newSteamid = self.steamid if self.is_bot(): newSteamid += self.name self.data = playerList[newSteamid] ''' def setClass(rpgClass): if rpgClass in CLASSES...
- Wed May 16, 2018 7:04 am
- Forum: Plugin Development Support
- Topic: Accessing properties of parent in subclass
- Replies: 3
- Views: 3487
Accessing properties of parent in subclass
SP keeps throwing errors whenever I try and access player.steamid in an object thats a subclass of players.entities.Player [SP] Caught an Exception: Traceback (most recent call last): File "..\addons\source-python\packages\source-python\events\listener.py", line 92, in fire_game_event call...
- Mon Oct 10, 2016 4:30 am
- Forum: News & Announcements
- Topic: A menus package is now available!
- Replies: 26
- Views: 71277
Re: A menus package is now available!
That's correct. If you want to remove the open menu, you'll need to add that functionality in yourself to close the already open menu.
- Tue Aug 30, 2016 3:27 am
- Forum: General Discussion
- Topic: SP crashing on linux?
- Replies: 45
- Views: 31080
Re: SP crashing on linux?
They have it working now.
- Tue Aug 23, 2016 6:10 pm
- Forum: Plugin Development Support
- Topic: Remove Unsafe Characters
- Replies: 4
- Views: 4035
Re: Remove Unsafe Characters
If you're worried about unsafe characters, you may also want to replace many unicode characters.
- Tue Aug 23, 2016 6:10 am
- Forum: Plugin Development Support
- Topic: Trouble with timers?
- Replies: 1
- Views: 2353
Re: Trouble with timers?
Tested this with a bot in the server and it seemed to work ok... @ClientCommand('damage') def cDamage(command, index): if getClass(index) == 'Cleric': playerMessage(index, 'before %s %s'%(dndPlayers[index]['shield'], time.strftime(&...
- Tue Aug 23, 2016 5:52 am
- Forum: Plugin Development Support
- Topic: Trouble with timers?
- Replies: 1
- Views: 2353
Trouble with timers?
Disclaimer: Yes, this code is not optimized and needs to be rewritten I'm having trouble getting a functional shield that recharges out of combat, similar to a shield from Halo (XBox). It appears that it is constantly recharging, and I do not want that to happen. The message does tell me that the ti...
- Mon Aug 22, 2016 3:26 am
- Forum: Plugin Development Support
- Topic: Calling server commands and retrieving server variables
- Replies: 1
- Views: 2254
Calling server commands and retrieving server variables
How is this done?