save reports
#1

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;
}
Reply
#2

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);
Reply
#3

some error.
Reply
#4

can you give me link of tutorials?
Reply
#5

what are the errors?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)