
TF2 run_command hook
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: TF2 run_command hook
Yes, sorry. 

Re: TF2 run_command hook
Yes, players.bots is correct.
You will also need to change is_bot to is_fake_client in that script.
You will also need to change is_bot to is_fake_client in that script.
Re: TF2 run_command hook
OK, just tried it and it still segfaults. Weird. I added a print statement just to make sure that is_fake_client() was working (it is, returned true). So the pointer isn't pointing to an instance of BotCmd either
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: TF2 run_command hook
Nice catch! Too many methods exposed, getting confusing without looking twice.satoon101 wrote:You will also need to change is_bot to is_fake_client in that script.

Maybe it is simply called with a NULL pointer... what does print(stack[1].address) prints to the console?quartata wrote:OK, just tried it and it still segfaults. Weird. I added a print statement just to make sure that is_fake_client() was working (it is, returned true). So the pointer isn't pointing to an instance of BotCmd either
Re: TF2 run_command hook
It's not 0.
Re: TF2 run_command hook
Off topic (although it was related to what I was planning to use the hook for), but is there any way to set a listener for when a certain client convar changes? I was going to use a tick listener and engine_server.get_client_convar_value but that feels a little inelegant.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: TF2 run_command hook
quartata wrote:Off topic (although it was related to what I was planning to use the hook for), but is there any way to set a listener for when a certain client convar changes? I was going to use a tick listener and engine_server.get_client_convar_value but that feels a little inelegant.
search.php?keywords=OnConVarChanged
Please, create a new topic next time!
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: TF2 run_command hook
As for the main issue of this topic, for now, you could simply filter bots and exit the callback. I will see if I can find the exact cause once my virtual is updated.
And please, could you create an issue on GitHub (be sure to link that thread) so we can keep track there? Thank you!
And please, could you create an issue on GitHub (be sure to link that thread) so we can keep track there? Thank you!
Re: TF2 run_command hook
L'In20Cible wrote:As for the main issue of this topic, for now, you could simply filter bots and exit the callback. I will see if I can find the exact cause once my virtual is updated.
Yeah, that's what I plan to do. It's really not a big deal since I would only being adding puppet bots for testing and it seems to work for "real" bots (NextBots).
Re: TF2 run_command hook
Issue added.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 50 guests