SA-MP Forums Archive
I have problem with command /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: I have problem with command /report (/showthread.php?tid=328106)



FIXED - RenSoprano - 23.03.2012

FIXED WITHOUT HELP


Re: I have problem with command /report - BigD - 23.03.2012

Its not an error its a warning, It doesn't matter, However if you do not know what that is then I don't reccomend making a script.


Re: I have problem with command /report - niels44 - 23.03.2012

try this:
pawn Код:
CMD:report(playerid,params[])
{
    new Target;
    new Reason[128];
    if(!sscanf(params, "us[32]",Target, Reason))
    {
        if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!");
        if(!IsPlayerConnected(Target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");

            new tname[MAX_PLAYER_NAME];  // Here on this line is pawn error
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(Target,tname,sizeof(tname));
            GetPlayerName(playerid,pname,sizeof(pname));

            new rstring[256];
            format(rstring,sizeof(rstring),"* Player %s(%d) reported %s(%d)! (Reason: %s)", pname,playerid,tname,Target,Reason);
            SendMessageToAdmins(COLOR_WHITE,rstring);

            new File:Log = fopen(reportPATH, io_append);
            new logData[128];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(Target,name,sizeof(name));
            new fTime[6];
            getdate(fTime[0], fTime[1], fTime[2]);
            gettime(fTime[3], fTime[4], fTime[5]);
            format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s got reported by %s! (Reason: %s)\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], tname, pname, Reason);
            fwrite(Log, logData);
            fclose(Log);
    }
    else return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report <playerid> <reason>");
    return 1;
}
and do what daniel said, this is only a warning but most of times loose identitation can affect it...

anyways loose identitation means that you have something on a different line then it swhould be.. in this case it was your closing bracket( } ), i placed it 1 TAB back and then its fixed