how can i do this?
#1

How can I make a key on the keyboard do something in game for example when i press 2 the engine turns on?
Reply
#2

That might help: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#3

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

https://sampwiki.blast.hk/wiki/Keys
Reply
#4

What You want to do?
Reply
#5

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_LOOK_BEHIND  && 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
#6

Check this script

https://sampforum.blast.hk/showthread.php?tid=476338
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)