09.10.2011, 18:52
Bump^
New issue, the report log is saved, but it displays the wrong text.
My Report Command. It displays "Your message was sent to the online admins" but i want it to output like my first post.
the file writing Stock
New issue, the report log is saved, but it displays the wrong text.
My Report Command. It displays "Your message was sent to the online admins" but i want it to output like my first post.
pawn Код:
CMD:report(playerid,params[])
{
new id, reason[35], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY,"[True:RP]: /report [playerid/partofname] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player ID");
else
{
GetPlayerName(id, name,sizeof(name));
GetPlayerName(playerid, sendername, sizeof(sendername));
new hour, minute, second, year, month, day;
gettime(hour, minute, second);
getdate(year, month, day);
format(string, sizeof(string), "[ID:%d] %s has reported %s: %s. [Date:%d/%d/%d][Time: %d:%d:%d]", playerid, sendername, name, reason, month, day, year, hour, minute, second);
ABroadCast(COLOR_LIGHTRED,string,1);
format(string, sizeof(string), "Use /markfalse [id] or /acceptreport [id]");
ABroadCast(COLOR_LIGHTBLUE,string,1);
format(string, sizeof(string), "Your report was just sent to the online admins use (/reply) to reply, please wait for a reply");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
PlayerNeedsHelp[playerid] = 1;
WriteReportsLog(string);
return 1;
}
}
the file writing Stock
pawn Код:
stock WriteReportsLog(string[])
{
if(!fexist("Reports.log")) dini_Create("Reports.log"); // You need to change dini_Create to your file creating system.
new
entry[255],
File: hFile;
format(entry, sizeof(entry), "%s\r\n", string);
hFile = fopen("Reports.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
}