[Ajuda] Comando nгo funciona
#4

Tenta assim e ve se vai dar certo
pawn Код:
if (strcmp("/comprarcarro", cmdtext, true, 10) == 0)
{
    if(PlayerInfo[playerid][CarKey1] == 999 || PlayerInfo[playerid][CarKey2] == 999 || PlayerInfo[playerid][CarKey3] == 999 || PlayerInfo[playerid][CarKey4] == 999 || PlayerInfo[playerid][CarKey5] == 999 || PlayerInfo[playerid][CarKey6] == 999)
    {
        if(IsPlayerInAnyVehicle(playerid)) //ve se o jogador estб dentro do carro
        {
            new carro = GetPlayerVehicleID(playerid);
            new TCarModel = GetVehicleModel(carro);
            if(DynamicCars[carro][Sell] == 1) // ve se o carro estб б venda ou nгo
            {
                for(new c=0;c<MAX_VEHICLES;c++)
                {
                    new valor2 = TCarModel-400;
                    new price = VehiclePrices[valor2][0]/2; //reduz o preзo de venda
                    new ctill = VehiclePrices[valor2][0]/5; //msm coisa
                    new cprice = price+ctill; //so,ma os preзos
                    if (price <= GetPlayerEuros(playerid)) //realmente,nгo sei
                    {
                        PlayerActionMessage(playerid,15.0,"paga a quantia ao ladrao de carro e pega nas chaves");
                        SendClientMessage(playerid, COLOR_YELLOW, "Compraste o carro com sucesso,cuidado com os cops.");
                        DynamicCars[carro][comprado] = 1; //torna o carro jб com dono
                        DynamicCars[carro][Sell] = 0; //torna o carro fora de venda
                        GivePlayerEuros(playerid, -cprice); //penso que retira o dinheiro
                        TogglePlayerControllable(playerid, 0); //o player pode voltar a mexer-se
                        if(PlayerInfo[playerid][CarKey1] == 999) // se a chave numero 1 estiver a 999,ele adiciona a chave do carro
                        {
                            PlayerInfo[playerid][CarKey1] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        else if(PlayerInfo[playerid][CarKey2] == 999)
                        {
                            PlayerInfo[playerid][CarKey2] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        else if(PlayerInfo[playerid][CarKey3] == 999)
                        {
                            PlayerInfo[playerid][CarKey3] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        else if(PlayerInfo[playerid][CarKey4] == 999)
                        {
                            PlayerInfo[playerid][CarKey4] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        else if(PlayerInfo[playerid][CarKey5] == 999)
                        {
                            PlayerInfo[playerid][CarKey5] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        else if(PlayerInfo[playerid][CarKey6] == 999)
                        {
                            PlayerInfo[playerid][CarKey6] = c+1;
                            DynamicCars[c][Multas] = 0;
                            DynamicCars[c][Licenca] = 0;
                        }
                        SaveDynamicCars();
                        OnPlayerDataSave(playerid);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "ERRO: Nгo tens dinheiro!");
                    }
                }
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "ERRO: Jб tens carros sufecientes!");
    }
    return 1;
}
Reply


Messages In This Thread
Comando nгo funciona - by caoraivoso3 - 23.07.2013, 20:24
Re: Comando nгo funciona - by PT - 23.07.2013, 20:44
Re: Comando nгo funciona - by caoraivoso3 - 23.07.2013, 20:56
Re: Comando nгo funciona - by GM_KoDi - 23.07.2013, 21:39
Re: Comando nгo funciona - by caoraivoso3 - 23.07.2013, 21:48
Re: Comando nгo funciona - by GM_KoDi - 23.07.2013, 21:50
Re: Comando nгo funciona - by caoraivoso3 - 24.07.2013, 08:00
Re: Comando nгo funciona - by caoraivoso3 - 24.07.2013, 14:38

Forum Jump:


Users browsing this thread: 1 Guest(s)