[Ajuda] Ligar e desligar carro com uma tecla
#8

Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
Ao meu ver "cont" deveria ser uma array global.
pawn Код:
// topo do GM/Abaixo das Includes
new cont[MAX_VEHICLES],


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new engine, lights, alarm, doors, bonnet, boot, objective,
        vehicleid = GetPlayerVehicleID(playerid);

        if(newkeys == 65536)
        {
            if(cont[vehicleid] == 0)
            {
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, -1, #Motor ligado);
                cont[vehicleid] = 1;
            }
            else if(cont[vehicleid] == 1)
            {
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, -1, #Motor desligado);
                cont[vehicleid] = 0;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Ligar e desligar carro com uma tecla - by Duun - 22.08.2014, 01:21
Re: Ligar e desligar carro com uma tecla - by Duun - 22.08.2014, 01:32
Re: Ligar e desligar carro com uma tecla - by Gii - 22.08.2014, 02:06
Re: Ligar e desligar carro com uma tecla - by Cor3y - 22.08.2014, 02:38
Re: Ligar e desligar carro com uma tecla - by Duun - 22.08.2014, 07:08
Re: Ligar e desligar carro com uma tecla - by Duun - 22.08.2014, 07:34
Re: Ligar e desligar carro com uma tecla - by AssasinoLM - 22.08.2014, 14:44
Re: Ligar e desligar carro com uma tecla - by Gii - 22.08.2014, 14:59
Re: Ligar e desligar carro com uma tecla - by Duun - 22.08.2014, 15:39
Re: Ligar e desligar carro com uma tecla - by Gii - 22.08.2014, 15:47

Forum Jump:


Users browsing this thread: 1 Guest(s)