Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Help with command

$
0
0
Hi friends, when a user places / report, the command works, but when put / report id reason, says ERROR: Unknown Command.

Command code:

PHP Code:

CMD:reportar(playeridparams[])
{
    new 
targetreason[98];
    if(
sscanf(params"us[98]"targetreason)) return SendClientMessage(playeridX11_THISTLE_1"USA: /reportar [jugador] [razon]");

    if(
strlen(reason) < 1) return SendClientMessage(playeridX11_FIREBRICK"ERROR: La longitud del reporte debe ser mayor a 1.");

    if(! 
IsPlayerConnected(target)) return SendClientMessage(playeridX11_FIREBRICK"ERROR: El jugador especifico no esta conectado.");

    if(
target == playerid) return SendClientMessage(playeridX11_FIREBRICK"ERROR: No puedes reportarte ati mismo.");

    new 
hourminutesecond;
    
gettime(hourminutesecond);

    for(new 
= (sizeof(gReportLog) - 1); > -1i++) gReportLog[i+1] = gReportLog[i];

    new 
string[145];
    
format(stringsizeof(string), "%02d:%02d | El jugador %s[%i] fue reportado por %s[%i] | Razon: %s"hourminuteReturnPlayerName(playerid), playeridReturnPlayerName(target), targetreason);
    
gReportLog[0] = string;
    
SendClientMessageForAdmins(X11_YELLOW_2string);

    foreach(new 
Player)
    {
        if(
gUser[i][u_admin] > 0)
           {
            
PlayerPlaySound(i10850.00.00.0);
            
#if defined REPORT_TEXTDRAW
                
TextDrawSetStringf(gReportTD"~b~~h~~h~~h~~h~%s(%i) ~b~~h~~h~~h~fue reportado por ~b~~h~~h~~h~~h~%s(%i) ~b~~h~~h~~h~Razon: ~b~~h~~h~~h~~h~%s"ReturnPlayerName(playerid), playeridReturnPlayerName(target), targetreason);
                
TextDrawShowForPlayer(igReportTD);
                
SetTimerEx("HideTD"10 1000false"i"i);
            
#endif
        
}
    }

    
SendClientMessagef(playeridX11_YELLOW_1"Tu reporte hacia %s[%i] fue enviado a los administradores."ReturnPlayerName(target), target);
    return 
1;
}

#if defined REPORT_TEXTDRAW
    
forward HideTD(playerid);
    public 
HideTD(playerid) return TextDrawHideForPlayer(playeridgReportTD);
#endif 


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>