Using EntityPreHook on drop_weapon
Posted: Sun Aug 02, 2015 9:08 pm
Hi,
how would I go about using EntityPreHook on drop_weapon for a player? I'm confused.. currently I have
But, it turns out the variable passed, ptr, is a StackData object. How can I get the player index/entity that dropped the weapon? Do I need to go in a completely different direction? :D
how would I go about using EntityPreHook on drop_weapon for a player? I'm confused.. currently I have
Syntax: Select all
from entities.helpers import index_from_pointer
from entities.hooks import EntityPreHook
@EntityPreHook('player', 'drop_weapon')
def pre_drop_weapon(ptr):
print(index_from_pointer(ptr))
return 2
But, it turns out the variable passed, ptr, is a StackData object. How can I get the player index/entity that dropped the weapon? Do I need to go in a completely different direction? :D