I'm trying to hook things such as entity creation and player run_command but they don't work at all. Nothing is output in console no matter what.
Example of code that works in tf2 but not tf2c (mod)
Code: Select all
from listeners import OnPlayerRunCommand
def IsPlayerBot(Obj):
if Obj.is_bot == True:
return True
elif Obj.playerinfo.is_fake_client():
return True
else:
return False
# This will never run #
@OnPlayerRunCommand
def on_player_run_command(player, user_cmd):
print("hook")
if (IsPlayerBot(player)):
user_cmd.forward_move = 0
user_cmd.side_move = 0
pass
Strangely though on_tick and on_player_say work fine. Right now I can work with that but its very limiting.
Does someone more experienced know what is happening and why it doesn't work?