[Pedido] Cуdigo de barreira
#1

Boa noite, nгo to achando o erro onde somente recebe a mensagem "Player removeu todas barreiras de sua organizaзгo". Mas nгo remove as barreiras.
Cуdigo para criar a barreira:
PHP Code:
CMD:br(playerid)
    {
        if(
PlayerInfo[playerid][pJailed] != 0)return SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode usar esse comando na cadeia!");
        if (!
IsACop(playerid) && GetPlayerOrg(playerid) != 20) return SendClientMessage(playeridCOLOR_GREY"Vocк nгo й COP/Bombeiro!");
        if(
GetPlayerInterior(playerid) > || IsPlayerInAnyVehicle(playerid))
            return 
SendClientMessage(playeridAMARELO_COR"Vocк nгo pode colocar uma barreira dentro de um veiculo ou em algum interior!");
        new 
prid 999;
        new 
string[128];
        for(new 
iMAX_BARREIRASi++){
            if(
BarreiraInfo[i][brCreated]){
                if (
BarreiraInfo[i][brID] == playerid) return SendClientMessage(playeridCOLOR_GREY"Vocк sу pode implantar 1 barreira por vez, /rbr - para remover a sua.");
            }
        }
        for(new 
iMAX_BARREIRASi++){
            if(!
BarreiraInfo[i][brCreated]){
                
prid i;
                break;
            }
        }
        if (
prid == 999) return SendClientMessage(playeridCOLOR_GREY" Hб muitas barreiras plantados no servidor!");
        new 
Float:XFloat:YFloat:ZFloat:A;
        
GetPlayerPos(playeridXYZ);
        
GetPlayerFacingAngle(playeridA);
        
BarreiraInfo[prid][brID]=playerid;
        
BarreiraInfo[prid][brCreated]=1;
        
BarreiraInfo[prid][brObject] = CreateDynamicObject(981XYZ0.00.0A+180);
        
GameTextForPlayer(playerid"~w~Barreira ~r~Plantada"50005);
        
SetPlayerPos(playeridXYZ+3);
        
format(stringsizeof string"[Barreira]\nCriada por: %s[ID: %d]"NomePlayer(playerid), playerid);
        
BarreiraInfo[prid][brText] = Create3DTextLabel(string,0x77BBFFFF,XY,10.00);
        
format(stringsizeof(string), "[%s] %s plantou uma barreira e fez um bloqueio."NomeORG(playerid),PlayerName(playerid));
        foreach(
Playeri)
        {
            if(
IsACop(i) || GetPlayerOrg(i) == 20)
            {
                
SendClientMessage(iTEAM_BLUE_COLORstring);
            }
        }
        return 
true;
    } 
Cуdigo para remover a barreira:
PHP Code:
CMD:rbr(playerid)
    {
        if (!
IsACop(playerid) && GetPlayerOrg(playerid) != 20) return SendClientMessage(playeridCOLOR_GREY"Vocк nгo й um Policial/bombeiro!");
        for(new 
iMAX_BARREIRASi++)
        {
            if(
BarreiraInfo[i][brCreated] && BarreiraInfo[i][brID] == playerid)
            {
                new 
string[128];
                
SendClientMessage(playeridCOLOR_GREY"Vocк retirou sua barreira!");
                
BarreiraInfo[i][brID]=999;
                
BarreiraInfo[i][brCreated]=0;
                
DestroyDynamicObject(BarreiraInfo[i][brObject]);
                
Delete3DTextLabel(BarreiraInfo[i][brText]);
                
format(stringsizeof(string), "[%s] %s removeu sua barreira."NomeORG(playerid),PlayerName(playerid));
                foreach(
Playerp)
                {
                    if(
IsACop(p) || GetPlayerOrg(p) == 20)
                    {
                        
SendClientMessage(pTEAM_BLUE_COLORstring);
                    }
                }
                return 
true;
            }
        }
        
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo plantou nenhuma barreira!");
        return 
true;
    } 
E esse й o cуdigo que nгo estб funcionando corretamente, somente a mensagem й enviada:
PHP Code:
CMD:dbr(playerid)
    {
        if(
PlayerInfo[playerid][pJailed] != 0)return SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode usar esse comando na cadeia!");
        if ((!
IsACop(playerid) && GetPlayerOrg(playerid) != 20||PlayerInfo[playerid][pCargo] < 5) && !PlayerInfo[playerid][pAdmin]) return SendClientMessage(playeridCOLOR_GREY"Vocк nгo й um Policial e ter cargo maior que 5.");
        
//new tpt = 0;
        
for(new 0MAX_PLAYERSi++)
        {
            if(
GetPlayerOrg(playerid) == GetPlayerOrg(i))
            {
                if(
BarreiraInfo[i][brCreated])
                {
                    
RemoveRoadblock(i);
                    
//tpt = 1;
                
}
               }
        }
        
//if(tpt == 0)return SendClientMessage(playerid, COLOR_GRAD1, "Nenhuma barreira foi plantada.");
        
new string[128];
        
format(stringsizeof(string), "[%s] %s removeu todas as barreiras de sua organizaзгo."NomeORG(playerid),PlayerName(playerid));
        foreach(
Playerp)
        {
            if(
IsACop(p) || GetPlayerOrg(p) == 20)
            {
                
SendClientMessage(pTEAM_BLUE_COLORstring);
            }
        }
        return 
true;
    } 
Alguйm poderia me ajudar a reparar isso? Agradeзo desde jб.
Reply
#2

Tente nгo tenho ctz
PHP Code:
MD:dbr(playerid)
{
    if(
PlayerInfo[playerid][pJailed] != 0)return SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode usar esse comando na cadeia!");
    if ((!
IsACop(playerid) && GetPlayerOrg(playerid) != 20||PlayerInfo[playerid][pCargo] < 5) && !PlayerInfo[playerid][pAdmin]) return SendClientMessage(playeridCOLOR_GREY"Vocк nгo й um Policial e ter cargo maior que 5.");
    for(new 
0MAX_PLAYERSi++)
     {
          if(
GetPlayerOrg(playerid) == GetPlayerOrg(i))
        {
             if(
BarreiraInfo[i][brCreated])
               {
                 
RemoveRoadblock(i);
                   
BarreiraInfo[i][brID] = 999;
                
BarreiraInfo[i][brCreated] = 0;
                
DestroyDynamicObject(BarreiraInfo[i][brObject]);
                
Delete3DTextLabel(BarreiraInfo[i][brText]);
            }
        }
    }
    new 
string[128];
    
format(stringsizeof(string), "[%s] %s removeu todas as barreiras de sua organizaзгo."NomeORG(playerid),PlayerName(playerid));
    foreach(
Playerp)
     {
         if(
IsACop(p) || GetPlayerOrg(p) == 20)
          {
               
SendClientMessage(pTEAM_BLUE_COLORstring);
         }
       }
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)