Vehicle motor start (ON/OFF)
#3

pawn Код:
#include <a_samp>

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);

        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
       
        if(engine == VEHICLE_PARAMS_UNSET || VEHICLE_PARAMS_OFF)
        {
            SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, 1, alarm, doors, bonnet, boot, objective);
        }
        SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, 1, alarm, doors, bonnet, boot, objective);
    }
   
    return 1;
}
Reply


Messages In This Thread
Vehicle motor start (ON/OFF) - by NexySamp - 14.08.2015, 15:48
Re: Vehicle motor start (ON/OFF) - by EncikBuyer - 14.08.2015, 15:58
Re: Vehicle motor start (ON/OFF) - by Abagail - 14.08.2015, 16:04
Re: Vehicle motor start (ON/OFF) - by NexySamp - 14.08.2015, 17:38
Re: Vehicle motor start (ON/OFF) - by iTakelot - 14.08.2015, 17:42
Re: Vehicle motor start (ON/OFF) - by Abagail - 14.08.2015, 18:05
Re: Vehicle motor start (ON/OFF) - by NexySamp - 14.08.2015, 18:16
Re: Vehicle motor start (ON/OFF) - by Vince - 14.08.2015, 18:25

Forum Jump:


Users browsing this thread: 1 Guest(s)