Command Unknowned. Where did i go wrong?
As the topic says what's wrong with the script i wrote?
Code:
#include <amxmodx>EDIT: this is the latest version. Problem is the command is executed on everyone. |
Re: Command Unknowned. Where did i go wrong?
Remove return PLUGIN_CONTINUE from plugin_init() function
|
Re: Command Unknowned. Where did i go wrong?
Still it executes on all players from the server instead of the targeted player name.
I think the problem resides here: new player = cmd_target(id, arg) |
Re: Command Unknowned. Where did i go wrong?
Check if player is more than 0 befor executing the command.
|
Re: Command Unknowned. Where did i go wrong?
first give cmd_target a flag because otherwise it will return 0 as failure
second check if the variable player is 0, because if its 0, then cmd_target didnt find a valid target lastly if player is 0 in client_cmd, it will think you wanted it to be executed on everyone. solution below PHP Code:
|
Re: Command Unknowned. Where did i go wrong?
PHP Code:
|
Re: Command Unknowned. Where did i go wrong?
lol oops cmd_target flag 8 forgot about that! @OP heres the flags list from the API
Flags: 1 - obey immunity 2 - allow yourself 4 - must be alive 8 - can't be bot |
Re: Command Unknowned. Where did i go wrong?
Quote:
http://www.amxmodx.org/funcwiki.php?...rget&go=search |
Re: Command Unknowned. Where did i go wrong?
Quote:
|
Re: Command Unknowned. Where did i go wrong?
So if cmd_target returns 0 on failure how come it failed when i gave a valid name; executed the command on valid player name?
By the way in case you didn't know, the command must be Connect, with capital 'C' else it won't be recognized. This is in effect since an update not long ago. Edit: Forgot to say thanks for the help, it works as it should now! |
| All times are GMT -4. The time now is 07:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.