[Ajuda] Venda de carro
#7

PHP код:
if(strcmp("/comprarcarro"cmdtrue) == 0)
    {
        new 
conceid;
        if(
sscanf(cmdtext"s[14]d"cmdconceid))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                for(new 
carro 0carro MAX_CONCEScarro++)
                {
                    
format(filesizeof(file), PASTA_CONCEcarro);
                    if(
dini_Exists(file))
                    {
                        if(
GetPlayerVehicleSeat(playerid) == && GetPlayerVehicleID(playerid) == dini_Int(file"Id"))
                        {
                            if(
dini_Int(file"TDono") == 0)
                            {
                                if(
GetPlayerGrana(playerid) >= dini_Int(file"Preco"))
                                {
                                    if(
GetCarros(playerid) < MAX_PLAYER_CONCE)
                                    {
                                        
dini_IntSet(file"TDono"1);
                                        
dini_Set(file"Dono"GetPlayerNameEx(playerid));
                                        if(!
IsPlayerVIP(playerid))
                                        {
                                            
GivePlayerGrana(playerid, -dini_Int(file"Preco"));
                                            
TogglePlayerControllable(playerid1);
                                            
dini_IntSet(file"CarVIP"0);
                                            
intest[playerid] = 0;
                                            
format(stringsizeof(string), "%s comprou um carro, deve estar feliz!"GetPlayerNameEx(playerid));
                                            
SendClientMessageToAll(roxostring);
                                            
ClearChatbox(playerid1);
                                            
SendClientMessage(playeridAzul"  Veнculo comprado com sucesso!");
                                            
SendClientMessage(playeridAzul"  Para ver os comandos do veнculo, use: /meucarro");
                                            
SendClientMessage(playeridLARANJA"|___________________________________________________________|");
                                        }
                                        else
                                        {
                                            
GivePlayerGrana(playerid, -dini_Int(file"Preco"));
                                            
TogglePlayerControllable(playerid1);
                                            
dini_IntSet(file"CarVIP"1);
                                            
intest[playerid] = 0;
                                            
format(stringsizeof(string), "%s comprou um carro equipado com alarme explosivo."GetPlayerNameEx(playerid));
                                            
SendClientMessageToAll(roxostring);
                                            
ClearChatbox(playerid1);
                                            
SendClientMessage(playeridAzul"  Veнculo comprado com sucesso!");
                                            
SendClientMessage(playeridAmarelo"  (VIP) Seu carro foi equipado com alarme explosivo.");
                                            
SendClientMessage(playeridAzul"  Para ver os comandos do veнculo, use: /meucarro");
                                            
SendClientMessage(playeridLARANJA"|___________________________________________________________|");
                                        }
                                        return 
1;
                                    }
                                    else
                                    {
                                        
SendClientMessage(playeridAmarelo"Vocк sу pode ter "#MAX_PLAYER_CONCE" carros!");
                                        
SendClientMessage(playeridVermelho"Para comprar outro venda um de seus!");
                                        return 
1;
                                    }
                                }
                                else
                                {
                                    
SendClientMessage(playeridVermelho"Vocк nгo tem dinheiro suficiente!");
                                    return 
1;
                                }
                            }
                            else
                            {
                                
SendClientMessage(playeridVermelho"Este veнculo nгo estб a venda!");
                                return 
1;
                            }
                        }
                    }
                }
            }
            
SendClientMessage(playeridVermelho"Use /comprarcarro [conceid]");
            return 
1;
        } 
Reply


Messages In This Thread
Venda de carro - by MacacuVuador - 24.12.2013, 14:44
Re: Venda de carro - by MacacuVuador - 24.12.2013, 15:45
Respuesta: Venda de carro - by [BWL]Chamaleon - 24.12.2013, 16:37
Re: Venda de carro - by MacacuVuador - 24.12.2013, 18:19
Re: Venda de carro - by MacacuVuador - 25.12.2013, 11:58
Re: Venda de carro - by GabrielSantos - 25.12.2013, 12:11
Re: Venda de carro - by MacacuVuador - 25.12.2013, 12:13
Re: Venda de carro - by GabrielSantos - 25.12.2013, 12:22

Forum Jump:


Users browsing this thread: 2 Guest(s)