save reports - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: save reports (
/showthread.php?tid=596617)
save reports -
GeneralAref - 20.12.2015
this is my report command. how to save reports in .ini file?
Код:
CMD:report(playerid, params[])
{
new id;
new reason[128];
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /report [Id] [Reason]");
new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(id, receiver, sizeof(receiver));
format(string, sizeof(string), "%s(%d) has reported %s(%d).Reason: %s", sender, playerid, receiver, id, reason);
SendMessageToAdmins(string);
SendClientMessage(playerid, COLOR_GREEN, "Your report has been sent.");
return 1;
}
Re: save reports -
StackedPizza - 20.12.2015
Try to put this on the top:
Код:
forward StoreReport(playerid,reported,reason[]);
Then put this somewhere:
Код:
public StoreReport(playerid,reported,reason[])
{
new hour,minute,second;
gettime(hour,minute,second);
for(new i = 0; i < MAX_REPORTS_STORE-1; i++)
Reports[i] = Reports[i+1];
format(string,sizeof(string),"%d:%d:%d - %s(ID: %d) Has Reported %s(ID: %d) |{FF0000} REASON: %s ",hour,minute,second,GetName(playerid),playerid,GetName(reported),reported,reason);
Reports[MAX_REPORTS_STORE-1] = string;
}
Then put this in the command:
Код:
WriteToLog(string,"Reports");
CallLocalFunction("StoreReport", "dds",playerid, id, reason);
Re: save reports -
GeneralAref - 20.12.2015
some error.
Re: save reports -
GeneralAref - 20.12.2015
can you give me link of tutorials?
Re: save reports -
StackedPizza - 20.12.2015
what are the errors?