There is any plugin that used to write commands in CHAT ?
example : if I'll write
!kick X in the
CHAT it will kick the player X ?
I found this : (credit to katna)
PHP Code:
#include <amxmodx>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const AmxCmds[][]= { "ct","t","roundtime","ft","freezetime","revive","restart","rr","gag","ungag","bury",
"unbury","rocket","kick","ban","slay","slap","map","glow", "noclip", "godmode", "pause",
"heal", "weapon", "ff","pass","nopass", "gravity","aa","alltalk", "restartserver" }
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say", "HandleSay" );
register_clcmd( "say_team", "HandleSay" );
}
public HandleSay(id) {
new message[128];
read_argv(1, message, 127);
for(new i=0;i<sizeof(AmxCmds);i++) {
new cmd[33];
formatex(cmd,32,"!%s",AmxCmds[i])
if(containi(message,cmd) == 0) {
if(!(get_user_flags(id) & ADMIN_CVAR))
return PLUGIN_CONTINUE;
HandleChatCmd(id,i);
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public HandleChatCmd(id, type) {
new message[128], cmd[33], arg[65], arg2[65], name[32];
read_argv (1, message, 128);
get_user_name(id,name,31);
parse(message,cmd,32,arg,64,arg2,64);
switch(type) {
case 1: // !ct
case 2: // !t
case 3: // !roundtime
case 4,5: // !ft,!freezetime
// and you keep continue...
}
}
Now , if I want !rr to do restart like (admin_rcon sv_restart 1) , how to do this ?