17.08.2011, 02:28
pawn Код:
CMD:ar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
print("Creating Variables");
new string[128], reportid;
print("Executing SSCANF");
if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ar [reportid]");
print("Checking Report ID");
if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; }
print("Checking report id for usage");
if(Reports[reportid][BeingUsed] == 0)
{
print("Sending report unused message");
SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
return 1;
}
print("Checking if player is connected");
if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
{
print("Sending player not connected message");
SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
print("Setting reportfrom to 999");
Reports[reportid][ReportFrom] = 999;
print("Setting BeingUsed to 0');
Reports[reportid][BeingUsed] = 0;
return 1;
}
print("formatting admin accepted message");
format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid);
print("Sending Admin Accepted Message to ABroadCast");
ABroadCast(COLOR_ORANGE, string, 2);
print("adding report token");
AddReportToken(playerid); // Report Tokens
print("formatting accepted messsage for player");
format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
print("Sending The accepted message to the player");
SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
print("Setting pAcceptReport ++");
PlayerInfo[playerid][pAcceptReport]++;
print("Setting Reply Timer");
Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid);
print("Setting CheckingReport to the admins id");
Reports[reportid][CheckingReport] = playerid;
print("Setting BeingUsed to 0");
Reports[reportid][BeingUsed] = 0;
print("Setting time to expire to 0");
Reports[reportid][TimeToExpire] = 0;
print("Executing strmid");
strmid(Reports[reportid][Report], "None", 0, 4, 4);
}
return 1;
}