Lock a report. - 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: Lock a report. (
/showthread.php?tid=597032)
Lock a report. -
KillerDVX - 25.12.2015
Hello guys.
So my problem is that i made a report system, and it contains a command "/fermereport" which we can close the report after the been resoluted.
But the main problem, is that I get an error message, says that "I never accepted a report" which I did.
PHP код:
dcmd_fermereport(playerid, params[])
{
#pragma unused params
new string[96];
if (GetPVarInt(playerid, "ReportID") != 0)
{
new reportid = GetPVarInt(playerid, "ReportID");
new reporter = PlayerThatReported[playerid];
SendClientMessage(reporter, COLOR_YELLOW, "Un Administrateur a fermй votre report.");
format(string, sizeof(string), "Vous avez fermй le report de #%d.", reportid);
SendClientMessage(playerid, COLOR_YELLOW, string);
AcceptingAdminID[reporter] = -1;
PlayerThatReported[playerid] = -1;
strmid(ReportInfo[reportid][rReporter], "", 0, strlen(""), 255);
strmid(ReportInfo[reportid][rReportString], "", 0, strlen(""), 255);
ReportInfo[reportid][rReportAnswered] = 0;
ReportIDTaken[reportid] = 0;
ReportInfo[reportid][rListitem][ReportInfo[reportid][rListitem]] = -1;
ReportCount -= 1;
ShuffleListitems();
DeletePVar(playerid, "ReportID");
return 1;
}
else SendClientMessage(playerid, COLOR_GREY, "{B22222}[ERREUR]: {FFFFFF}You never accepted a report."); //Here
return 1;
}
Hope for a solution.
Re: Lock a report. -
JaKe Elite - 25.12.2015
Have you make sure that the Player Var "ReportID" have been used on your accepted report command?
What is stored in Var ReportID, is it a playerID? (if it is a playerID then it will always be like that for the admin who accepted the report of playerID 0)
Re: Lock a report. -
KillerDVX - 25.12.2015
The var "ReportID" is used in 2 functions, first for Accept and second for Deny.
So, when I accept the report, it gives :
PHP код:
AcceptReport(playerid, GetPVarInt(playerid, "ReportID"));
PHP код:
stock AcceptReport(playerid, reportid)
{
new
reporter = -1,
string[128];
for (new i = 0; i < MAX_PLAYERS; i += 1)
{
if (strcmp(ReportInfo[reportid][rReporter], PlayerName(i), false) == 0)
{
reporter = i;
break;
}
}
if (reporter != -1)
{
SendClientMessage(reporter, COLOR_LIGHTBLUE, "Un Administrateur a acceptй votre report, merci d'y avoir signalй.");
format(string, sizeof(string), "Vous avez acceptй le report: #%d, reportй par %s (ID: %d).", reportid, PlayerName(reporter), reporter);
SendClientMessage(playerid, COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_WHITE, "{B22222}[UTILISATION]: {FFFFFF}Utilisez {B22222}/fermereport {FFFFFF}aprиs la rйsolution du problиme.");
AcceptingAdminID[reporter] = playerid;
PlayerThatReported[playerid] = reporter;
ReportInfo[reportid][rReportAnswered] = 1;
return 1;
}
else SendClientMessage(playerid, COLOR_GREY, "{B22222}[ERREUR]: {FFFFFF}Le reporter est dйconnectй.");
return 1;
}