Hop Command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hop Command (
/showthread.php?tid=256959)
Hop Command -
fiki574 - 23.05.2011
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?
Re: Hop Command -
fiki574 - 23.05.2011
bump...
Re: Hop Command -
fiki574 - 23.05.2011
bump... help me pls
Re: Hop Command -
Wesley221 - 23.05.2011
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;
}
Re: Hop Command -
fiki574 - 23.05.2011
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?
Re: Hop Command -
Wesley221 - 23.05.2011
pawn Код:
if (PRESSED(KEY_SUBMISSION))
Just change "KEY_SUBMISSION" to what key you want
Re: Hop Command -
fiki574 - 23.05.2011
Can u gimme an example, pls? cause if i change it it dont works!
Re: Hop Command -
Mauzen - 23.05.2011
You probably did not even try. Check this for a list of all key names:
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Re: Hop Command -
fiki574 - 23.05.2011
Dont works! I tried KEY_LOOK_LEFT and still dont works! PLS HELP!
Re: Hop Command -
Mauzen - 23.05.2011
There are more keys with "LEFT" in them that you could test...