06.04.2011, 08:17
Report:
That saves the report in the serverlogs, to be honest /acceptreport seems a bit unusual to me.
Adminchat:
pawn Code:
COMMAND:report(playerid,params[])
{
new id,reason[64];
if(sscanf(params,"is[64]",id,reason)) return SendClientMessage(playerid,color_red,"USAGE: /report [playerid] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color_red,"Player not connected.");
new counter = 0;for(new i = 0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][Level] > 0)
{
SendClientMessageEx(i,color_orange,"sssisssisss","Incomming report from ",PlayerInfo[playerid][Username],"(",playerid,") Reporting ",PlayerInfo[id][Username],"(",id,"), Reason: ",reason,".");
counter++;
}
}
printf("%s has reported %s (Reason:%s)",PlayerInfo[playerid][Username],PlayerInfo[id][Username],reason);
return SendClientMessageEx(playerid,color_orange,"sis","Your report has been sent to all online administrators (",counter," at the moment).");
}
Adminchat:
pawn Code:
COMMAND:a(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
new text[128];
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,color_red,"USAGE: /a [text]");
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][Level] < 1) continue;
SendClientMessageEx(i,color_yellow,"ssss","Adminchat: ",PlayerInfo[playerid][Username],": {FFFFFF}",text);
}
return 1;
}