I need 2 thing's over here.
1. A /reports command
2. It will be saved in a log
pawn Код:
if (strcmp("/report", cmdtext, true, 10) == 0)
{
//new tmp[256], idx;
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0x0000FFFF,"USAGE: /report [playerid] [reason]");
SendClientMessage(playerid,0x0000FFFF,"Will report a player to the admins.");
return 1;
}
new id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,0xCC0000FF,"Player not connected.");
return 1;
}
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
tmp = strrest(cmdtext,idx);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME], string[128];
GetPlayerName(id, pname, sizeof(pname));
GetPlayerName(playerid, pname2, sizeof(pname2));
tmp = strrest(cmdtext, idx);
format(string, sizeof(string), "REPORT: %s (ID:%d) was reported by %s (ID:%d), Reason: %s", pname,id, pname2,playerid,tmp);
MessageForAdmins(0xFF0000FF,string);
format(string, sizeof(string), "Your report has been sent to the admins!");
SendClientMessage(playerid,0xFFFFFFFF,string);
PlayerPlaySound(playerid,1057,0,0,0);
}
return 1;
}