[Ajuda] /comprarb Bug!?
#1

O pawn ta travando mas eu n sei como arrumar pq se eu der tab ele vai tirar a ultima chave e vai dar warning

pawn Код:
if(!strcmp(cmdtext, "/plantarb", true))
    {
        if(bomb1[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem Bomba!");
            return 1;
        }
        if(Bombp != 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Alguem ja plantou uma bomba aqui.");
            return 1;
        }
        if(!PlayerToPoint(2.0 ,playerid, 1928.771484,-1785.187012,13.139766))
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
            return 1;
        }
         if(Explodido != 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
            return 1;
        }
        pdinhe1 = 0;
        pdinhe2 = 0;
        pdinhe3 = 0;
        pdinhe4 = 0;
        pdinhe5 = 0;
        pdinhe6 = 0;
        pdinhe7 = 0;
        Bombp = 1;
        bomb1[playerid] = 0;
        bombe[playerid] = 1;
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк plantou uma Bomba no caixa Digite /explodirb.");
        GameTextForPlayer(playerid,"~r~Bomba plantada",5000, 5);
        return 1;
        }
        else if(bomb11[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem Bomba!");
            return 1;
        }
        if(Bombpp != 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Alguem ja plantou uma bomba aqui.");
            return 1;
        }
        if(!PlayerToPoint(2.0 ,playerid, 2232.3899,-1162.6554,25.8906))
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
            return 1;
        }
         if(Explodidoo != 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
            return 1;
        }
        pdinhe11 = 0;
        pdinhe22 = 0;
        pdinhe33 = 0;
        pdinhe44 = 0;
        pdinhe55 = 0;
        pdinhe66 = 0;
        pdinhe77 = 0;
        Bombpp = 1;
        bomb11[playerid] = 0;
        bombee[playerid] = 1;
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк plantou uma Bomba no caixa Digite /explodirb.");
        GameTextForPlayer(playerid,"~r~Bomba plantada",5000, 5);
        return 1;
    }
Reply
#2

Tenta IsPlayerInRangeOfPoint
Reply
#3

FINAL OLHA o novo cod que eu coloquei ai em cima
Reply
#4

Quote:
Originally Posted by zGuigui2068
Посмотреть сообщение
FINAL OLHA o novo cod que eu coloquei ai em cima
Vocк adicionou uma chave a mais

PHP код:
if(!strcmp(cmdtext"/plantarb"true))
{
    
    if(
bomb1[playerid] != 1)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem Bomba!");
        return 
1;
    }
    if(
Bombp != 0)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Alguem ja plantou uma bomba aqui.");
        return 
1;
    }
    if(!
PlayerToPoint(2.0 ,playerid1928.771484,-1785.187012,13.139766))
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Vocк Nгo esta no caixa eletronico.");
        return 
1;
    }
    if(
Explodido != 0)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 
1;
    }
    
pdinhe1 0;
    
pdinhe2 0;
    
pdinhe3 0;
    
pdinhe4 0;
    
pdinhe5 0;
    
pdinhe6 0;
    
pdinhe7 0;
    
Bombp 1;
    
bomb1[playerid] = 0;
    
bombe[playerid] = 1;
    
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    
GameTextForPlayer(playerid,"~r~Bomba plantada",50005);
    
    else if(
bomb11[playerid] != 1)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem Bomba!");
        return 
1;
    }
    if(
Bombpp != 0)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Alguem ja plantou uma bomba aqui.");
        return 
1;
    }
    if(!
PlayerToPoint(2.0 ,playerid2232.3899,-1162.6554,25.8906))
    {
        
        
SendClientMessage(playeridCOLOR_GREY"Vocк Nгo esta no caixa eletronico.");
        return 
1;
    }
    if(
Explodidoo != 0)
    {
        
        
SendClientMessage(playeridCOLOR_GREY"o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 
1;
    }
    
pdinhe11 0;
    
pdinhe22 0;
    
pdinhe33 0;
    
pdinhe44 0;
    
pdinhe55 0;
    
pdinhe66 0;
    
pdinhe77 0;
    
Bombpp 1;
    
bomb11[playerid] = 0;
    
bombee[playerid] = 1;
    
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    
GameTextForPlayer(playerid,"~r~Bomba plantada",50005);
    
    return 
1;

Tenta...
Reply
#5

Editado vou testar
Reply
#6

pawn Код:
if(!strcmp(cmdtext, "/pdinhe1", true))
    {
        if(!PlayerToPoint(1.0 ,playerid, 1932.0181,-1783.9647,13.3828))
        {
            return 1;
        }
        if(pdinhe1 != 0)
        {
            return 1;
        }
        GranaRockstar(playerid, 50000);
        DestroyObject(dinhe1);
        pdinhe1 = 1;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pegou dinheiro no chгo.");
        return 1;
 }
    else if(!strcmp(cmdtext, "/pdinhe1", true))
    {
        if(!PlayerToPoint(1.0 ,playerid, 2228.2974,-1159.6223,25.7885))
        {
            return 1;
        }
        if(pdinhe11 != 0)
        {
            return 1;
        }
        GranaRockstar(playerid, 50000);
        DestroyObject(dinhe11);
        pdinhe11 = 1;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pegou dinheiro no chгo.");
        return 1;
 }
Como eu faria isso ?

tipo pq o cmd pra pegar o dinheiro do chao й esse pedinhe1 e sгo varios ai vc me falando eu ja arrumo aq

vlw mesmo ja por tar ajudando
Reply
#7

Vc estб comparando comandos, vc irб usar um comando por vez entгo nгo use else if

PHP код:
if(!strcmp(cmdtext"/pdinhe1"true))
    {
        if(
PlayerToPoint(1.0 ,playerid1932.0181,-1783.9647,13.3828) && pdinhe1 != 0)
        {
                        
GranaRockstar(playerid50000);
                    
DestroyObject(dinhe1);
                    
pdinhe1 1;
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"Pegou dinheiro no chгo.");
            return 
1;
        }
            else return 
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vocк nгo estб prуximo da бrea.");
        return 
1;
 }
     if(!
strcmp(cmdtext"/pdinhe1"true))
    {
        if(
PlayerToPoint(1.0 ,playerid2228.2974,-1159.6223,25.7885))
        {
                        
GranaRockstar(playerid50000);
                    
DestroyObject(dinhe11);
                    
pdinhe11 1;
                    
SendClientMessage(playeridCOLOR_LIGHTBLUE"Pegou dinheiro no chгo.");
            return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vocк nгo estб prуximo da бrea.");
        return 
1;
 } 
ou

PHP код:
if(!strcmp(cmdtext"/pdinhe"true))
    {
        if(
PlayerToPoint(1.0 ,playerid1932.0181,-1783.9647,13.3828) && pdinhe1 != 0)
        {
                        
GranaRockstar(playerid50000);
                    
DestroyObject(dinhe1);
                    
pdinhe1 1;
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"Pegou dinheiro no chгo.");
            return 
1;
        }
            else if(
PlayerToPoint(1.0 ,playerid2228.2974,-1159.6223,25.7885) && pdinhe11 != 0)
        {
                        
GranaRockstar(playerid50000);
                    
DestroyObject(dinhe11);
                    
pdinhe11 1;
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"Pegou dinheiro no chгo.");
            return 
1;
        }
            else return 
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vocк nгo estб prуximo da бrea.");
        return 
1;
 } 
Reply
#8

Bugo meu comentario
Reply
#9

Mano me ajuda compilei aq deu esses 2 erros:

pawn Код:
if(!strcmp(cmdtext, "/explodirb", true))
    {
        if(bombe[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo plantou uma bomba!");
            return 1;
        }
        if(!PlayerToPoint(60.0 ,playerid, 1928.771484,-1785.187012,13.139766))
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
            return 1;
        }
        GameTextForPlayer(playerid,"~r~Bomba explodida",5000, 5);
        Bombp = 0;
        DestroyObject(caixa1);
        bombe[playerid] = 0;
        Iniciarbomba();
        concertar2();
        SendClientMessageToAll(-1, "[Camera de seguranзa]um Caixa eletronico foi explodido em LS.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк Explodiu um caixa eletronico,pegue o dinheiro do chгo apertando enter!.");
        SetTimer("concertar", 300000, false);
        return 1;
        if(bombee[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo plantou uma bomba!");
            return 1;
        }
        if(!PlayerToPoint(60.0 ,playerid, 2232.3901,-1162.6427,25.8906))
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
            return 1;
        }
        GameTextForPlayer(playerid,"~r~Bomba explodida",5000, 5);
        Bombpp = 0;
        DestroyObject(caixa11);
        bombee[playerid] = 0;
        Iniciarbombaa();
        concertar22();
        SendClientMessageToAll(-1, "[Camera de seguranзa]um Caixa eletronico foi explodido em LS.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк Explodiu um caixa eletronico,pegue o dinheiro do chгo apertando enter!.");
        SetTimer("concertarr", 300000, false);
        return 1;
    }
pawn Код:
if(!strcmp(cmdtext, "/plantarb", true))
{
    if(bomb1[playerid] != 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem Bomba!");
        return 1;
    }
    if(Bombp != 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "Alguem ja plantou uma bomba aqui.");
        return 1;
    }
    if(!PlayerToPoint(2.0 ,playerid, 1928.771484,-1785.187012,13.139766))
    {
        SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
        return 1;
    }
    if(Explodido != 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 1;
    }
    pdinhe1 = 0;
    pdinhe2 = 0;
    pdinhe3 = 0;
    pdinhe4 = 0;
    pdinhe5 = 0;
    pdinhe6 = 0;
    pdinhe7 = 0;
    Bombp = 1;
    bomb11[playerid] = 0;
    bomb1[playerid] = 0;
    bombe[playerid] = 1;
    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    GameTextForPlayer(playerid,"~r~Bomba plantada",5000, 5);
    else if(bomb11[playerid] != 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem Bomba!");
        return 1;
    }
    if(Bombpp != 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "Alguem ja plantou uma bomba aqui.");
        return 1;
    }
    if(!PlayerToPoint(2.0 ,playerid, 2232.3899,-1162.6554,25.8906))
    {
        SendClientMessage(playerid, COLOR_GREY, "Vocк Nгo esta no caixa eletronico.");
        return 1;
    }
    if(Explodidoo != 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 1;
    }
    pdinhe11 = 0;
    pdinhe22 = 0;
    pdinhe33 = 0;
    pdinhe44 = 0;
    pdinhe55 = 0;
    pdinhe66 = 0;
    pdinhe77 = 0;
    Bombpp = 1;
    bomb1[playerid] = 0;
    bomb11[playerid] = 0;
    bombee[playerid] = 1;
    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    GameTextForPlayer(playerid,"~r~Bomba plantada",5000, 5);
    return 1;
}

C:\Users\Gustavo\Desktop\BSR GM OF - Cуpia\BSR GM OF - Cуpia\Gamemodes\BSR.pwn(21462) : error 029: invalid expression, assumed zero
C:\Users\Gustavo\Desktop\BSR GM OF - Cуpia\BSR GM OF - Cуpia\Gamemodes\BSR.pwn(21462) : warning 215: expression has no effect
C:\Users\Gustavo\Desktop\BSR GM OF - Cуpia\BSR GM OF - Cуpia\Gamemodes\BSR.pwn(21462) : error 001: expected token: ";", but found "if"
C:\Users\Gustavo\Desktop\BSR GM OF - Cуpia\BSR GM OF - Cуpia\Gamemodes\BSR.pwn(21751) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#10

Sу pra avisar, o comando pode n funcionar corretamente, vc precisa adapta-lo melhor:

PHP код:
if(!strcmp(cmdtext"/plantarb"true))
{
    if(
bomb1[playerid] != 1)
    {
        
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem Bomba!");
        return 
1;
    }
    if(
Bombp != 0)
    {
        
SendClientMessage(playeridCOLOR_GREY"Alguem ja plantou uma bomba aqui.");
        return 
1;
    }
    if(!
PlayerToPoint(2.0 ,playerid1928.771484,-1785.187012,13.139766))
    {
        
SendClientMessage(playeridCOLOR_GREY"Vocк Nгo esta no caixa eletronico.");
        return 
1;
    }
    if(
Explodido != 0)
    {
        
SendClientMessage(playeridCOLOR_GREY"o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 
1;
    }
    
pdinhe1 0;
    
pdinhe2 0;
    
pdinhe3 0;
    
pdinhe4 0;
    
pdinhe5 0;
    
pdinhe6 0;
    
pdinhe7 0;
    
Bombp 1;
    
bomb11[playerid] = 0;
    
bomb1[playerid] = 0;
    
bombe[playerid] = 1;
    
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    
GameTextForPlayer(playerid,"~r~Bomba plantada",50005);
    if(
bomb11[playerid] != 1)
    {
        
SendClientMessage(playeridCOLOR_GREY"Vocк nгo tem Bomba!");
        return 
1;
    }
    if(
Bombpp != 0)
    {
        
SendClientMessage(playeridCOLOR_GREY"Alguem ja plantou uma bomba aqui.");
        return 
1;
    }
    if(!
PlayerToPoint(2.0 ,playerid2232.3899,-1162.6554,25.8906))
    {
        
SendClientMessage(playeridCOLOR_GREY"Vocк Nгo esta no caixa eletronico.");
        return 
1;
    }
    if(
Explodidoo != 0)
    {
        
SendClientMessage(playeridCOLOR_GREY"o caixa elкtronico foi explodido, espere quando ele estiver pronto!.");
        return 
1;
    }
    
pdinhe11 0;
    
pdinhe22 0;
    
pdinhe33 0;
    
pdinhe44 0;
    
pdinhe55 0;
    
pdinhe66 0;
    
pdinhe77 0;
    
Bombpp 1;
    
bomb1[playerid] = 0;
    
bomb11[playerid] = 0;
    
bombee[playerid] = 1;
    
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк plantou uma Bomba no caixa Digite /explodirb.");
    
GameTextForPlayer(playerid,"~r~Bomba plantada",50005);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)