PHP Code:
#include <amxmodx>
new g_maxplayers
new bool:gsent
public plugin_init() {
register_clcmd("say","hooksay")
register_clcmd("say_team","hooksay")
g_maxplayers = get_maxplayers()
}
public hooksay(id)
{
new args[192]
read_args(args, charsmax(args))
remove_quotes(args) // take the raw string
if(equali(args,"/complaint",10))
{
new cmd[33], argm[192], szname[33]
get_user_name(id,szname,charsmax(szname))
strbreak(args, cmd, 31, argm, 191)
if(!strlen(argm)){
client_printc(id,"!g[COMPLAINT] !nYou didn't type any complaints.")
return PLUGIN_HANDLED
}
for(new i; i <= g_maxplayers; i++)
{
if(get_user_flags(i) & ADMIN_KICK && is_user_connected(i)){
client_printc(i,"!g[COMPLAINT] !t%s: !n%s",szname,argm)
client_cmd(i,"spk buttons/blip1")
gsent = true
}
}
if(gsent){
client_printc(id,"!g[COMPLAINT] !nYour complaint has been sent successfuly.")
gsent = false
}
else
client_printc(id,"!g[COMPLAINT] !nFailed. No admins online.")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
stock client_printc(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01");
replace_all(msg, 190, "!g", "^x04");
replace_all(msg, 190, "!t", "^x03");
if (id) players[0] = id; else get_players(players, count, "ch"); {
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
__________________