[14/03/12] [15:07:01] Reklez has report Johnny | Reason: Testing
new RCount = 0;
CMD:report(playerid, params[])
{
new string[128],
id,
pname[MAX_PLAYER_NAME],
name[MAX_PLAYER_NAME],
Year,
Day,
Month,
Hour,
Minute,
Second,
File:reportlog,
reason[30];
if(sscanf(params, "us[30]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /report <playerid/name> <reason>");
GetPlayerName(id, name, sizeof(name));
GetPlayerName(playerid, pname, sizeof(pname));
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid-Playerid");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot report yourself!");
format(string, sizeof(string), "REPORT: %s(ID:%d) "yellow"has report "white"%s(ID:%d) | "red"Reason: %s", pname, playerid, name, id, reason);
MessageToAdmins(COLOR_WHITE, string);
RCount++;
reportlog = fopen("ServerFiles/Log/reports.txt", io_append);
format(string, sizeof(string), "[%d/%d/%d] [%d:%d:%d]: %s has report %s for %s\r\n", Day, Month, Year, Hour, Minute, Second, pname, playerid, name, id, reason);
fwrite(reportlog, string);
fclose(reportlog);
format(string, sizeof(string), "You report %s(ID:%d) | Reason: %s", name, id, reason);
SendClientMessage(playerid, COLOR_RED, string);
SendClientMessage(playerid, COLOR_YELLOW, "| - Your report has been sent from Online Administrators and saved from our database as .txt!");
return 1;
}
format(string, sizeof(string), "You report %s(ID:%d) | Reason: %s", name, id, reason);
ShowPlayerDialog(playerid,1518,DIALOG_STYLE_MSGBOX,"You have successfully reported",string,"Close","");
[16/3/2012] [14:44:41]: Reklez has report for Reklez
pawn Код:
|