SA-MP Forums Archive
Help me with this please - 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)
+--- Thread: Help me with this please (/showthread.php?tid=482893)



Help me with this please - Acres - 23.12.2013

Hey guys i would like to know how i am abel to make like that if you write /jump IG then you will jump with car in the air but how i am abel to make it like i press 3 on my Numpad and it jumps? please help.


Re: Help me with this please - Konstantinos - 23.12.2013

NUM 3 is not a valid key: https://sampwiki.blast.hk/wiki/Keys

You can use SetVehicleVelocity and change the Z (height) parameter so the vehicle will jump.

pawn Код:
CMD:jump(playerid, params[])
{
    if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You need to be a driver to use that command");
   
    new
        vehicleid = GetPlayerVehicleID(playerid),
        Float: vx,
        Float: vy,
        Float: vz;
       
    GetVehicleVelocity(vehicleid, vx, vy, vz);
    SetVehicleVelocity(vehicleid, vx, vy, vz + 0.3);
    return 1;
}