[Ajuda] Meu GM pode prender sem ta nos procurados ajuda ?
#1

PHP код:
if(strcmp(cmd"/prender"true) == 0)
    {
        
format(filesizeof(file), PASTA_CONTASGetPlayerNameEx(playerid));
        if(
dini_Int(file"Profissao") == Policial_C || dini_Int(file"Profissao") == Policial_F || dini_Int(file"Profissao") == Delegado || dini_Int(file"Profissao") == Bope || dini_Int(file"Profissao") == Swat || dini_Int(file"Profissao") == Narcoticos || dini_Int(file"Profissao") == Policial_M || dini_Int(file"Profissao") == FBI || dini_Int(file"Profissao") == Interpol || dini_Int(file"Profissao") == LSPD || dini_Int(file"aAdmin") == || PlayerInfo[playerid][SCON] == true)
        {
            new 
plidmotivo[64];
            if(
sscanf(cmdtext"s[5]us[64]"cmdplidmotivo))
            {
                
SendClientMessage(playeridVermelho"Use: /prender [id] [motivo]");
                return 
1;
            }
            if(
IsPlayerInAnyVehicle(plid) || IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playeridVermelho"Alguem estб dentro de um carro.");
                return 
;
            }
            if(
plid == playerid)
            {
                
SendClientMessage(playeridVermelho"Vocк nгo pode fazer isto com si mesmo.");
                return 
;
            }
            if(!
IsPlayerConnected(plid))
            {
                
SendClientMessage(playeridVermelho"O(A) jogador(a) nгo estб conectado.");
            }
            else
            {
                if(
GetDistanceBetweenPlayers(plidplayerid) < 10)
                {
                    {
                        
PrenderPlayer(plid);
                        
GivePlayerGrana(playerid700);
                        
format(stringsizeof(string), "O oficial da lei %s te prendeu. Porque vocк era um procurado/suspeito(a)."GetPlayerNameEx(playerid));
                        
SendClientMessage(plidBluestring);
                        
format(stringsizeof(string), "O jogador %s (ID: %d) Foi Preso por %s (ID: %d)Motivo: %s"GetPlayerNameEx(plid), GetPlayerNameEx(playerid), motivo);
                        
SendClientMessageToAll(Bluestring);
                    }
                }
                else
                {
                    
SendClientMessage(playeridVermelho"Chegue mais perto para prender!");
                }
            }
        }
        else
        {
            
SendClientMessage(playeridVermelho"Apenas policiais podem usar este comando!");
        }
        return 
1;
    } 
Esse eh o comando , tб dando pra prender sem tб nos procurados oquк eu fasso ? AJUDA AEH +REP'
Reply
#2

Estude isto

https://sampwiki.blast.hk/wiki/GetPlayerWantedLevel
Reply
#3

pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
    {
        format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 2 || PlayerInfo[playerid][SCON] == true)
        {
            new plid, motivo[64];

            if(sscanf(cmdtext, "s[5]us[64]", cmd, plid, motivo))
            {
                SendClientMessage(playerid, Vermelho, "Use: /prender [id] [motivo]");
                return 1;
            }
            if(IsPlayerInAnyVehicle(plid) || IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid, Vermelho, "Alguem estб dentro de um carro.");
                return 1 ;
            }
            if(GetPlayerWantedLevel(plid)) == 0)
            {
                return SendClientMessage(playerid,Cinza,"Vocк nгo pode prender uma pessoa sem nнveis de procurado!");
            }
            if(plid == playerid)
            {
                SendClientMessage(playerid, Vermelho, "Vocк nгo pode fazer isto com si mesmo.");
                return 1 ;
            }
            if(!IsPlayerConnected(plid))
            {
                SendClientMessage(playerid, Vermelho, "O(A) jogador(a) nгo estб conectado.");
            }
            else
            {
                if(GetDistanceBetweenPlayers(plid, playerid) < 10)
                {
                    {
                        PrenderPlayer(plid);
                        GivePlayerGrana(playerid, 700);

                        format(string, sizeof(string), "O oficial da lei %s te prendeu. Porque vocк era um procurado/suspeito(a).", GetPlayerNameEx(playerid));
                        SendClientMessage(plid, Blue, string);

                        format(string, sizeof(string), "O jogador %s (ID: %d) Foi Preso por %s (ID: %d)Motivo: %s", GetPlayerNameEx(plid), GetPlayerNameEx(playerid), motivo);
                        SendClientMessageToAll(Blue, string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, Vermelho, "Chegue mais perto para prender!");
                }
            }
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "Apenas policiais podem usar este comando!");
        }
        return 1;
    }
Reply
#4

Й sу verificar se o plid ta procurado ou nгo.
Reply
#5

Como assim nгo entendii Break !
Tб dando pra prender as pessoas sem ela tб nos procurados !
Reply
#6

if(GetPlayerWantedLevel(plid) >= 1)

Se nгo me engano й assim xD


Muito tempo sem programar...
Reply
#7

Eu jб postei acima
Reply
#8

Biel tб dando erro oq cmd quк vcк posto lek !
Tф tentando arrumar !


Quote:

C:\Users\Nilda\Documents\GM Brasil Vida Nova ™\gamemodes\BVN.pwn(13236) : error 029: invalid expression, assumed zero
C:\Users\Nilda\Documents\GM Brasil Vida Nova ™\gamemodes\BVN.pwn(13236) : warning 215: expression has no effect
C:\Users\Nilda\Documents\GM Brasil Vida Nova ™\gamemodes\BVN.pwn(13236) : error 001: expected token: ";", but found ")"
C:\Users\Nilda\Documents\GM Brasil Vida Nova ™\gamemodes\BVN.pwn(13236) : error 029: invalid expression, assumed zero
C:\Users\Nilda\Documents\GM Brasil Vida Nova ™\gamemodes\BVN.pwn(13236) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#9

Troque de

pawn Код:
if(GetPlayerWantedLevel(plid)) == 0)
{
     return SendClientMessage(playerid,Cinza,"Vocк nгo pode prender uma pessoa sem nнveis de procurado!");
}
Para

pawn Код:
if(GetPlayerWantedLevel(plid) == 0)
{
     return SendClientMessage(playerid,Cinza,"Vocк nгo pode prender uma pessoa sem nнveis de procurado!");
}
Reply
#10

Valeu biel min ajudo muito cara flw ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)