Syntax: Select all
@SayCommand('!knife')
def sayHintText(say, index, team_only=None):
p = Player(index)
p.set_active_weapon(Weapon('weapon_knife'))
But I get an error
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\commands\auth.py", line 44, in __call__
return self.callback(*args)
File "..\addons\source-python\plugins\t\t.py", line 72, in sayHintText
p.set_active_weapon(Weapon('weapon_knife'))
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
Boost.Python.ArgumentError: Python argument types in
BaseEntity.__init__(Weapon, str)
did not match C++ signature:
__init__(class boost::python::api::object, unsigned int entity_index)