Vehicle Jump
#1

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

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;
}
Reply
#3

Thanks a lot.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)