LOL
Every word i say in chat, me or a random player takes like command in console.
If i write in chat "slay player" it will write in my console "amx_slay player" and works for any random player.
If i write in chat "lol_why_is_not_working" it will write in my console "amx_lol_why_is_not_working"
But i have the "if" in my hook_say, i want only to check if he says /goto or /go
PHP Code:
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say","hook_say");
register_clcmd("amx_goto","cmdGOTO");
register_clcmd("amx_go","cmdGOTO");
}
public hook_say(id) {
new s_Args[192];
read_args(s_Args, sizeof(s_Args) - 1);
remove_quotes(s_Args);
if(equal(s_Args, "/goto", 5) || (s_Args,"/go",3)) {
replace(s_Args, sizeof(s_Args) - 1, "/", "");
client_cmd(id, "amx_%s", s_Args);
}
return PLUGIN_CONTINUE;
}
LATER EDIT :
I solved the problem, but i have a question.
Q : How could i make only 1 if ?
PHP Code:
public hook_say(id) {
static s_Args[192];
read_args(s_Args, sizeof(s_Args) - 1);
remove_quotes(s_Args);
if(equal(s_Args, "/goto", 5)) {
replace(s_Args, sizeof(s_Args) - 1, "/", "");
client_cmd(id, "amx_%s", s_Args);
}
else if(equal(s_Args,"/go",3)) {
replace(s_Args, sizeof(s_Args) - 1, "/", "");
client_cmd(id, "amx_%s", s_Args);
}
return PLUGIN_CONTINUE;
}