Hop Command
#1

Can someone pls tell me how to make /hop command so I can hop my vehicle in air? And can it be used by pressing for example NUMPAD 4?
Reply
#2

bump...
Reply
#3

bump... help me pls
Reply
#4

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


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_SUBMISSION)) // change this to what you want
    {
    new Float:x, Float:y, Float:z; new vehicle=GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(vehicle,x,y,z);
        SetVehicleVelocity(vehicle,x,y,z+2); // change the +2 with the height you want
    }
    else
    {
        GetPlayerVelocity(playerid, x, y, z);
        SetPlayerVelocity(playerid, x, y, z + 2.0); //remove this if you dont want to hop with player
    }
    }
    return 1;
}
Reply
#5

Tnx! But one tiny problem: its not bounded to NUm4, it is bounded to 2 (i already have lip here) and NUM1(camera looks back)! Can u make one button so it can be used in vehicle and on foot by pressing NUM4?
Reply
#6

pawn Код:
if (PRESSED(KEY_SUBMISSION))
Just change "KEY_SUBMISSION" to what key you want
Reply
#7

Can u gimme an example, pls? cause if i change it it dont works!
Reply
#8

You probably did not even try. Check this for a list of all key names: https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#9

Dont works! I tried KEY_LOOK_LEFT and still dont works! PLS HELP!
Reply
#10

There are more keys with "LEFT" in them that you could test...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)