/report system
#1

hi guys, anyone knows how i can create mine /report sytem? i know how to use ini save system , i am saving players stats with it, but how i can save whatevr players reports?
Thanks
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=356867

If that's not what you're looking for utilize the search function on these forums.
Reply
#3

You can make a system of reports without ini or sql. For example, make a variable like
PlayerInfo[playerid][pReported] = 0; and PlayerInfo[playerid][pReportMessage]; ( pReported, pReportMessage[64];


/report command:

Код HTML:
CMD:report(playerid, params[])
{
	new message[128],admins=0;
	if(sscanf(params, "s[128]", message)) return SCM(playerid, COLOR_GREY, SYNTAX_MESSAGE"/report [text]");
	{
				foreach(Player, i)
		     	{
					if(PlayerData[i][pAdmin] >= 1)
					{
						admins++;
					}
				}
				if(admins == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: There are no admins online.");
new string128[256];
				format(string128, sizeof(string128), "Your report message was sent to admins.");
				SendClientMessage(playerid, 0xFFFFFFFF, string128);
				format(string128, sizeof(string128), "Report from %s [%d]: %s.",PlayerInfo[playerid][pNormalName],playerid, message);
				submitToAdmins(string128,COLOR_LIGHTRED);
				PlayerInfo[playerid][pReported] = 1;
				format(PlayerInfo[playerid][pReportMessage], 256,"%s", string128);
	}
	return 1;
}
and

Код HTML:
CMD:reports(playerid, params[])
{
	new count = 0;
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		foreach(Player, i)
		{
			if(PlayerInfo[i][pReported] == 1)
			{
				SCM(playerid, COLOR_LIGHTRED, PlayerInfo[i][pReportMessage]);
				count++;
			}
		}
		format(szMessage,256, "Total reports: %d", count);
		SCM(playerid, -1, szMessage);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)