Report System HELP
#1

I am making a report system and so far I have finished it. Just one little bug. You can accept the report over and over again. Here is the /ar command. Someone please help. Will post more Code on Request.

pawn Код:
CMD:ar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new id, string[126];
        if(sscanf(params, "u", id))
            return SendClientMessage(playerid, -1, "Syntax: /ar [player id]");

        DeletePVar(id, "ReportPending");
        DeletePVar(id, "ReportText");
        DeletePVar(id, "ReportTime");

        format(string, sizeof(string), "%s has accepted the report from %s (ID %d)", GetName(playerid), GetName(id), id);
        SendToAdmins(0xFFA200FF, string);

        format(string, sizeof(string), "%s has accepted your report. Please wait for the the admin to resolve the issue.", GetName(playerid));
        SendClientMessage(id, COLOR_YELLOW, string);
    }
    return 1;
}
Reply
#2

You are not making a check when executing the command to make sure the player has a report pending or w.e


pawn Код:
CMD:ar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new id, string[126];
        if(sscanf(params, "u", id))
            return SendClientMessage(playerid, -1, "Syntax: /ar [player id]");
if(somepvarthatchecks if the player has sent a report ectera == 1)
{


        DeletePVar(id, "ReportPending");
        DeletePVar(id, "ReportText");
        DeletePVar(id, "ReportTime");

        format(string, sizeof(string), "%s has accepted the report from %s (ID %d)", GetName(playerid), GetName(id), id);
        SendToAdmins(0xFFA200FF, string);

        format(string, sizeof(string), "%s has accepted your report. Please wait for the the admin to resolve the issue.", GetName(playerid));
        SendClientMessage(id, COLOR_YELLOW, string);
    }
    return 1;
else
{
SCM(playerid, green, "this player dosetn ahve a report");
}

}
I hope you understand what I mean.
Reply
#3

How would I make it check the pvar?
Reply
#4

bump please I need help
Reply
#5

Bump
Reply
#6

Код:
CMD:ar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		new string[128], reportid/*, y,m,d,h,mi,s*/;
		if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "{6347AA}[Error]:{FFFFFF} /ar [reportid]");

		if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, "   Report ID not below 0 or above 999!"); return 1; }
		if(Reports[reportid][BeingUsed] == 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "   That report ID is not being used!");
			return 1;
		}
		if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "   The reporter has disconnected !");
			Reports[reportid][ReportFrom] = 999;
			Reports[reportid][BeingUsed] = 0;
			return 1;
		}
		//AddReportToken(playerid); // Report Tokens
		//getdate(y, m, d);
		//gettime(h, mi, s);
		format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid);
		ABroadCast(COLOR_ORANGE, string, 2);
		SendClientMessageEx(Reports[reportid][ReportFrom], 0x00FF0059, "______ .: REPORT ACCEPTED :. ______");
		format(string, sizeof(string), "Admin Name %s", GetPlayerNameEx(playerid));
		SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
		format(string, sizeof(string), "Your Name %s", GetPlayerNameEx(Reports[reportid][ReportFrom]));
		SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
		//format(string, sizeof(string), "Correct Time&Date: %d/%d/%d %d:%d:%d [day/month/year hour:minute:second] ", d,m,y,h,mi,s);
		//SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
		SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, "Your report is accepted. use /reply to talk");
		SendClientMessageEx(Reports[reportid][ReportFrom], 0x00FF0059, "___________________________");
		PlayerInfo[playerid][pAcceptReport]++;
		Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 50000, 0, "d", reportid);
		Reports[reportid][CheckingReport] = playerid;
		Reports[reportid][BeingUsed] = 0;
		Reports[reportid][TimeToExpire] = 0;
		strmid(Reports[reportid][Report], "None", 0, 4, 4);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)