SA-MP Forums Archive
[FIX]: Report command - 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: [FIX]: Report command (/showthread.php?tid=427927)



[FIX]: Report command - Areax - 03.04.2013

Hi!

I have another question...

Is this code OK?

CODE:

PHP код:
COMMAND:report(playerid,params[]) {
    new
        
name1[30],
        
name2[30],
        
id,
        
text[128],
        
reason[50];
    if(
sscanf(params,"us",id,reason))
        return 
SendClientMessage(playeridCOLOR_RED,"Usage: /report [id] [reason]");
    if(
IsPlayerConnected(id)) {
        
SendClientMessage(playerid,COLOR_GREEN,"Thanks for reporting. Your report have been sent to online administartor.");
        for(new 
0MAX_PLAYERS; ++i) {
            if(
gPlayerInfo[playerid][PLAYER_LEVEL] < 1)
            {
            
GetPlayerName(playerid,name1,sizeof(name1));
            
GetPlayerName(id,name2,sizeof(name2));
            new 
Hour,Minute,Second;
            
gettime(Hour,Minute,Second);
            
format(text,sizeof(text),"|| %d:%d:%d || [Report] | \"%s\" [%i] has reported \"%s\" [%i], reason: %s.",Hour,Minute,Second,name1,playerid,name2,id,reason);
            
SendClientMessage(i,COLOR_YELLOW,text);
            
ReportLog(text);
        }
        }
    } else {
        return 
SendClientMessage(playerid,COLOR_RED,"ERROR: This player is not connected.");
    }
    return 
1;

I get no ERRORS and ingame everything works, only admins don't get report.


Re: [FIX]: Report command - judothijs - 03.04.2013

pawn Код:
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1)
Adjust < 1 to >= 1, and playerid to i