09.02.2017, 22:10
How to get the latest 5 reports?
PHP код:
CMD:report(playerid,params[])
{
new id,reason[50],string[300];
if(sscanf(params,"us[178]",id, reason)) return SendClientMessage(playerid, -1,"USAGE: /report [playerid] [reason]");
format(string,sizeof(string),"[Notice]: Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
lastreport = string;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pData[i][Admin] >= 3 || IsPlayerAdmin(i))
{
SendClientMessage(i, 0xFF0000FF, string);
}
}
format(string,sizeof(string),"Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
IRC_Say(groupID,"%"IRC_CHANNEL, string);
return 1;
}
CMD:reports(playerid, params[])
{
if(pData[playerid][Admin] >= 3)
{
SendClientMessage(playerid, COLOR_YELLOW, "Last report was:");
SendClientMessage(playerid, 0xFF0000FF, lastreport);
} else return SendClientMessage(playerid,COLOR_YELLOW,"Only +level 3 can use this command");
return 1;
}