Lock a report.
#1

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(playeridparams[])
{
    
#pragma unused params
    
new string[96];
    if (
GetPVarInt(playerid"ReportID") != 0)
    {
        new 
reportid GetPVarInt(playerid"ReportID");
        new 
reporter PlayerThatReported[playerid];
        
SendClientMessage(reporterCOLOR_YELLOW"Un Administrateur a fermй votre report.");
        
format(stringsizeof(string), "Vous avez fermй le report de #%d."reportid);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
AcceptingAdminID[reporter] = -1;
        
PlayerThatReported[playerid] = -1;
        
strmid(ReportInfo[reportid][rReporter], ""0strlen(""), 255);
        
strmid(ReportInfo[reportid][rReportString], ""0strlen(""), 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(playeridCOLOR_GREY"{B22222}[ERREUR]: {FFFFFF}You never accepted a report."); //Here
    
return 1;

Hope for a solution.
Reply
#2

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

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(playeridGetPVarInt(playerid"ReportID")); 
PHP код:
stock AcceptReport(playeridreportid)
{
    new
        
reporter = -1,
        
string[128];
    for (new 
0MAX_PLAYERS+= 1)
    {
        if (
strcmp(ReportInfo[reportid][rReporter], PlayerName(i), false) == 0)
        {
            
reporter i;
            break;
        }
    }
    if (
reporter != -1)
    {
        
SendClientMessage(reporterCOLOR_LIGHTBLUE"Un Administrateur a acceptй votre report, merci d'y avoir signalй.");
        
format(stringsizeof(string), "Vous avez acceptй le report: #%d, reportй par %s (ID: %d)."reportidPlayerName(reporter), reporter);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
SendClientMessage(playeridCOLOR_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(playeridCOLOR_GREY"{B22222}[ERREUR]: {FFFFFF}Le reporter est dйconnectй.");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)