KEY_JUMP in vehicle?
#1

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)