SA-MP Forums Archive
[Ajuda] Carros Vip Bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Carros Vip Bug (/showthread.php?tid=439588)



Carros Vip Bug - Bruno13 - 26.05.2013

Olб, estou com um problema e sem conseguir entender o sistema vim apelar para o forum.sa-mp. O sistema de vip do brasil playhappy esta com problema, tipo onde tem os carros a venda para vips, quando compra da tudo certo, porйm os comandos do /ajudacarro estгo dizendo que nгo estou em um veiculo vip, nem se quer /vendercarro esta pegando.
Vou deixar o comando de comprar o carro:
PHP Code:
    if(strcmp(cmd"/comprarcarro"true) == 0)
    {
         if(
IsPlayerConnected(playerid))
          {
            if(!
IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playerid,COLOR_GREY,"Vocк precisa estar no veiculo VIP!");
                return 
1;
            }
              new 
vehid GetPlayerVehicleID(playerid);
             if(
PlayerInfo[playerid][pVIP] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo й VIP e nгo pode comprar este carro !");
                return 
true;
            }
               for(new 
0sizeof(CarInfo); i++)
              {
                if(
CarInfo[i][ownedvehicle] == vehid)
                {
                     if(
PlayerInfo[playerid][pVIP] == 0)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Vocк nгo й VIP e nгo pode comprar este carro !");
                        
RemovePlayerFromVehicleEx(playerid);
                        return 
true;
                    }
                    if(
PlayerInfo[playerid][pCarKey] != && PlayerInfo[playerid][pCarKey2] != && PlayerInfo[playerid][pCarKey3] != 0  && PlayerInfo[playerid][pVIP] == 1)
                    
//if(PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pVIP] == 1)
                    
{
                        
SendClientMessage(playeridCOLOR_GREY"Seu VIP permite que vocк tenha no mбximo 3 carros !");
                        
RemovePlayerFromVehicleEx(playerid);
                        return 
true;
                    }
                    if(
PlayerInfo[playerid][pCarKey] != &&
                    
PlayerInfo[playerid][pCarKey2] != &&
                    
PlayerInfo[playerid][pCarKey3] != &&
                    
PlayerInfo[playerid][pCarKey4] != &&
                    
PlayerInfo[playerid][pCarKey5] != &&
                    
PlayerInfo[playerid][pVIP] == 2)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Seu SUPER-VIP permite que vocк tenha no mбximo 5 carros !");
                        
RemovePlayerFromVehicleEx(playerid);
                        return 
true;
                    }
                    if(
PlayerInfo[playerid][pLevel] < 3)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Vocк Precisa ter nivel 3 para comprar o veiculo");
                          
RemovePlayerFromVehicleEx(playerid);
                          return 
true;
                    }
                    if(
CarInfo[i][cOwned]==1)
                    {
                           
SendClientMessage(playeridCOLOR_GREY"Este carro VIP/SUPER-VIP jб tem dono");
                        return 
true;
                    }
                    if(
PlayerInfo[playerid][pCarKey] == 0)
                    {
                        if(
PlayerInfo[playerid][pVIP] < 1)
                         {
                             
SendClientMessage(playeridCOLOR_GREY"Vocк nгo й um jogador VIP");
                                return 
true;
                        }
                        if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                        {
                            
PlayerInfo[playerid][pCarKey] = i+totalveiculosc;
                            
PlayerInfo[playerid][pVeiculo] = i;
                            
CarInfo[i][cOwned] = 1;
                            
CarOffered[playerid]=0;
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                            
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                            
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro PREMIUM!"50003);
                            
PlayerPlaySound(playerid11470.00.00.0);
                            
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ajudacarro para ver os comandos");
                            
Controle(playerid1);
                            
SaveCars();
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            
RemovePlayerFromVehicleEx(playerid);
                        }
                        return 
true;
                    }
                     else if(
PlayerInfo[playerid][pCarKey2] == 0)
                    {
                        if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                        {
                            
PlayerInfo[playerid][pCarKey2] = i+totalveiculosc;
                            
PlayerInfo[playerid][pVeiculo2] = i;
                            
CarInfo[i][cOwned] = 1;
                            
CarOffered[playerid]=0;
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                            
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                            
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro Premium!"50003);
                            
PlayerPlaySound(playerid11470.00.00.0);
                            
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ajudacarro para ver os comandos");
                            
Controle(playerid1);
                            
SaveCars();
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            
RemovePlayerFromVehicleEx(playerid);
                        }
                        return 
true;
                    }
                     else if(
PlayerInfo[playerid][pCarKey3] == 0)
                    {
                        if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                        {
                            
PlayerInfo[playerid][pCarKey3] = i+totalveiculosc;
                            
PlayerInfo[playerid][pVeiculo3] = i;
                            
CarInfo[i][cOwned] = 1;
                            
CarOffered[playerid]=0;
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                            
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                            
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro Premium!"50003);
                            
PlayerPlaySound(playerid11470.00.00.0);
                            
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ajudacarro para ver os comandos");
                            
Controle(playerid1);
                            
SaveCars();
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            
RemovePlayerFromVehicleEx(playerid);
                        }
                        return 
true;
                    }
                     else if(
PlayerInfo[playerid][pCarKey4] == 0)
                    {
                        if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                        {
                            
PlayerInfo[playerid][pCarKey4] = i+totalveiculosc;
                            
PlayerInfo[playerid][pVeiculo4] = i;
                            
CarInfo[i][cOwned] = 1;
                            
CarOffered[playerid]=0;
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                            
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                            
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro Premium!"50003);
                            
PlayerPlaySound(playerid11470.00.00.0);
                            
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ajudacarro para ver os comandos");
                            
Controle(playerid1);
                            
SaveCars();
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            
RemovePlayerFromVehicleEx(playerid);
                        }
                        return 
true;
                    }
                      else if(
PlayerInfo[playerid][pCarKey5] == 0)
                    {
                        if(
GetPlayerMoney(playerid) >= CarInfo[i][cValue])
                        {
                            
PlayerInfo[playerid][pCarKey5] = i+totalveiculosc;
                            
PlayerInfo[playerid][pVeiculo5] = i;
                            
CarInfo[i][cOwned] = 1;
                            
CarOffered[playerid]=0;
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
strmid(CarInfo[i][cOwner], sendername0strlen(sendername), 999);
                            
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
                            
GameTextForPlayer(playerid"~w~Parabens~n~Voce comprou esse Carro Premium!"50003);
                            
PlayerPlaySound(playerid11470.00.00.0);
                            
SendClientMessage(playeridCOLOR_GRAD2"parabens pela sua compra !");
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ajudacarro para ver os comandos");
                            
Controle(playerid1);
                            
SaveCars();
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem dinheiro para isso!");
                            
RemovePlayerFromVehicleEx(playerid);
                        }
                        return 
true;
                    }
                }
            }
        }
        return 
true;
    }