SA-MP Forums Archive
Vehicle Jump - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Vehicle Jump (/showthread.php?tid=477852)



Vehicle Jump - Spike Cena - 26.11.2013

Hey Guys.


I have this:

Код:
#include a_samp

#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_SUBMISSION)))
    {
    if (IsPlayerInAnyVehicle(playerid))
    {
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {

        new
            Float:x,
            Float:y,
            Float:z;
        GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
        SetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,0.3);
    }
    }
    }
    return 1;
}
Car Jumps on number 2 and I want to change that to Letter H or any other Letter ,becouse of the Taxi,Bus etc. mini missions who starts on number 2 so the chat gets spawned all the time,but I don't know how...


Re: Vehicle Jump - Konstantinos - 26.11.2013

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

KEY_CROUCH is H/Caps Lock for vehicles. Also you need to add + 0.3 from the z height.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_CROUCH)))
    {
        if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
           
            new
                Float:x,
                Float:y,
                Float:z;
            GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
            SetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z+0.3);
        }
    }
    return 1;
}



Re: Vehicle Jump - Spike Cena - 26.11.2013

Thanks a lot.