SA-MP Forums Archive
KEY_JUMP in vehicle? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: KEY_JUMP in vehicle? (/showthread.php?tid=194569)



KEY_JUMP in vehicle? - TaMeD - 29.11.2010

I am using 0.3c, so I don't know if that'll affect this script or not..

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    if(PRESSED( KEY_JUMP ))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vid = GetPlayerVehicleID(playerid);
            new getcar = GetCar(vid,1);
            if(Vehicle[getcar][vEngine] == 0)
            {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,1,alarm,doors,bonnet,boot,objective);
                Vehicle[getcar][vEngine] = 1;
            }
            else if(Vehicle[getcar][vEngine] == 1)
            {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,1,alarm,doors,bonnet,boot,objective);
                Vehicle[getcar][vEngine] = 0;
            }
        }
    }
    return 1;
}
When I go in game and hit my jump button (Left shift), the engine does not start/stop. However when I hit S (brake/reverse), it does. I know you can make this work, because I've seen it done. I just can't work it out.

Help!


EDIT: Looks like others are having trouble in 0.3c too.