Engine Command
#2

pawn Код:
CMD:engine(playerid, params[])
{
    if(GetPlayerState(playerid) == 2) //2 is the drivers state, not 0.
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(Engine[vehicleid] == 0)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[vehicleid] = 1;
            SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, 0);
        }
    }
    else
    {
        if(GetPlayerState(playerid) == 2)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(Engine[vehicleid] == 1)
            {
                new engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                Engine[vehicleid] = 0; //changed the 1 here previously to 0 so it stores it as off.
                SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, 0);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Engine Command - by AnonScripter - 22.09.2013, 20:55
Re: Engine Command - by EiresJason - 22.09.2013, 21:00
Re: Engine Command - by AnonScripter - 22.09.2013, 21:18
Re: Engine Command - by EiresJason - 22.09.2013, 21:24
Re: Engine Command - by AnonScripter - 22.09.2013, 21:48
Re: Engine Command - by EiresJason - 22.09.2013, 21:55
Re: Engine Command - by AnonScripter - 22.09.2013, 22:03
Re: Engine Command - by EiresJason - 22.09.2013, 22:12
Re: Engine Command - by AnonScripter - 22.09.2013, 22:28
Re: Engine Command - by EiresJason - 22.09.2013, 22:33

Forum Jump:


Users browsing this thread: 4 Guest(s)