Start engine pressing an button
#2

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & EnterTheKeyYouWantHere && IsPlayerInAnyVehicle(playerid))
    {
        new EngineStatus, lights, alarm, doors, bonnet, boot, objective;
        new vid = GetPlayerVehicleID(playerid);      
        GetVehicleParamsEx(vid,EngineStatus,lights,alarm,doors,bonnet,boot,objective);
        if(vid != INVALID_VEHICLE_ID && EngineStatus== 0)
        {
            SetVehicleParamsEx(vid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); //engine started
        }
        else if(vid != INVALID_VEHICLE_ID && EngineStatus== 1)
        {
            SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective); //engine stopped
        }
    }
    return 1;
}
Reply


Messages In This Thread
Start engine pressing an button - by Malakay - 04.08.2011, 19:15
AW: Start engine pressing an button - by Drebin - 04.08.2011, 19:21
Re: Start engine pressing an button - by AndreT - 04.08.2011, 19:23
Re: Start engine pressing an button - by Malakay - 04.08.2011, 19:26
Re: Start engine pressing an button - by Malakay - 04.08.2011, 20:13
Re: Start engine pressing an button - by MadeMan - 04.08.2011, 20:16
Re: Start engine pressing an button - by Malakay - 04.08.2011, 20:31
Re: Start engine pressing an button - by LZLo - 04.08.2011, 20:36
Re: Start engine pressing an button - by Malakay - 04.08.2011, 20:37
Re: Start engine pressing an button - by Malakay - 04.08.2011, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)