#include <amxmodx>
public plugin_init() {
register_clcmd("say", "@GetMessage")
register_clcmd("say /msg", "@test", ADMIN_BAN)
register_clcmd("msg2", "@test2")
}
@test(id) {
client_print(id, print_chat, "msg")
return PLUGIN_HANDLED
}
@test2(id) {
client_print(id, print_chat, "msg2")
}
@GetMessage(id) {
new szMessage[192]
read_args(szMessage, charsmax(szMessage))
remove_quotes(szMessage); trim(szMessage)
if(szMessage[0] == '/') {
if(!bIsValidCmd(szMessage)) client_print(id , print_chat , "Команда %s не найдена" , szMessage);
return PLUGIN_HANDLED_MAIN;
}
return PLUGIN_CONTINUE
}
bool:bIsValidCmd(const szCmd[])
{
new iNumCmd = get_clcmdsnum(-1), i , szCommand[64] , iFlags , szInfo[128];
for(i = 0; i < iNumCmd; i++) {
get_clcmd(i , szCommand , charsmax(szCommand) , iFlags , szInfo , charsmax(szInfo) , -1);
server_print("cmd %s - check cmd %s", szCmd, szCommand);
if(strcmp(szCommand, szCmd) == 0)
return true;
}
return false;
}