Raised This Month: $51 Target: $400
 12% 

Force bot execute command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaBBa
Member
Join Date: Dec 2012
Old 09-19-2020 , 12:10   Force bot execute command
Reply With Quote #1

Hello, I want bot to execute command registered by my other plugin

I tried this:
Code:
client_cmd(id, "get_weapon_m4a1")
but seems like it's not working on bots, also triedthis:

Code:
engclient_cmd(id, "get_weapon_m4a1")
but engclient_cmd is not working even on ordinary players, it didn't do anything.
SaBBa is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-19-2020 , 12:21   Re: Force bot execute command
Reply With Quote #2

Quote:
Originally Posted by SaBBa View Post
my other plugin
Problem?

callfunc_*?
That's all I'm giving you without any actual code.
__________________
Black Rose is offline
SaBBa
Member
Join Date: Dec 2012
Old 09-19-2020 , 22:08   Re: Force bot execute command
Reply With Quote #3

Quote:
Originally Posted by Black Rose View Post
Problem?

callfunc_*?
That's all I'm giving you without any actual code.
THANK YOU GOOD SIR
didn't knew about that func, thanks a lot
SaBBa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-19-2020 , 23:20   Re: Force bot execute command
Reply With Quote #4

engclient_cmd() sends a command to the engine, it will not be processed by AMX Mod X or any plugin. If you're using AMX Mod X 1.9.0+ you can use amxclient_cmd() to send a command to the server and WILL be processed by AMX Mod X and plugins. Using amxclient_cmd() is probably the best option because you don't need to know any of the internal code for the other plugin.
__________________
fysiks is offline
SaBBa
Member
Join Date: Dec 2012
Old 09-20-2020 , 05:32   Re: Force bot execute command
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
engclient_cmd() sends a command to the engine, it will not be processed by AMX Mod X or any plugin. If you're using AMX Mod X 1.9.0+ you can use amxclient_cmd() to send a command to the server and WILL be processed by AMX Mod X and plugins. Using amxclient_cmd() is probably the best option because you don't need to know any of the internal code for the other plugin.
Yeah, probably that will be better alternative, also I am curious about usages, calling function from from another plugin with callfunc or any other method consumes more resources than executing plung's command with amxclient_cmd() ?
SaBBa is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-20-2020 , 06:15   Re: Force bot execute command
Reply With Quote #6

Quote:
Originally Posted by SaBBa View Post
Yeah, probably that will be better alternative, also I am curious about usages, calling function from from another plugin with callfunc or any other method consumes more resources than executing plung's command with amxclient_cmd() ?
Performance is never an issue outside loops or forwards called on every server frame.
__________________
Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode