#1

Hey guys!
this command is optimized?
PHP код:
CMD:procurar(playeridparams[]) {
    if(
PlayerInfo[playerid][pOrg] != org@Federal) {
        return 
SendClientMessage(playerid,-1,"SERVER: Vocк nгo й um membro da Organizaзгo de Polнcia Federal");
    } else {
        new
            
targetid,
            
motivo[40],
            
Float:p[3],
            
i
        
;
        if(
sscanf(params,"is[40]",targetidmotivo)) {
            return 
SendClientMessage(playerid,-1,"SERVER: ERRO DE SINTAXE! /procurar [targetid][motivo]");
        } else {
            if(!
IsPlayerConnected(targetid)) {
                return 
SendFormattedMessage(playerid, -1,"SERVER: O id %i nгo estб conectado"targetid);
            } else {
                
GetPlayerPos(targetidp[0], p[1], p[2]);
                if(!
IsPlayerInRangeOfPoint(playerid5.0p[0], p[1], p[2])) {
                    return 
SendFormattedMessage(playerid, -1,"SERVER: Vocк nгo estб perto do jogador id %i"targetid);
                } else {
                    
SetPlayerWantedLevel(targetidGetPlayerWantedLevel(targetid)+1);
                    
PlayerInfo[playerid][pProcurado] = true;
                    
SendFormattedMessage(targetid, -1,"PROCURADO: O policial %s colocou vocк na lista de procurados por %s",replace(playerid), motivo);
                    
SendFormattedMessage(playerid, -1,"SUCESSO: Vocк colocou o jogador %s na lista de procurados por %s",replace(targetid),motivo);
                    for( ; 
MAX_PLAYERS; ++i) {
                        if(
IsPlayerConnected(i) && PlayerInfo[playerid][pAdmin] >= 1) {
                            
SendFormattedMessage(iCOLOR_BLUE,"ALERTA: O policial %s(%i) colocou o jogador %s(%i) na lista de procurados por %s",replace(playerid),playerid,replace(targetid),targetidmotivo);
                        }
                        if(
IsPlayerConnected(i) && PlayerInfo[playerid][pOrg] == org@Federal) {
                            
SendFormattedMessage(iCOLOR_BLUE,"RADIO POLICIAL: O policial %s colocou o jogador %s na lista de procurados por %s",replace(playerid),replace(targetid),motivo);
                        }
                    }
                }
            }
        }
    }
    return 
1;

Reply
#2

I think so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)