SA-MP Forums Archive
Vehicle JumpFunction - 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: Vehicle JumpFunction (/showthread.php?tid=203674)



Vehicle JumpFunction[SOLVED] - park4bmx - 27.12.2010

Hi im trying to make VehicleJumpFunction
And this is how im doing it But i dont know how exactly to do it so i need help
pawn Код:
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(currentveh, vehx, vehy, vehz);
SetVehiclePos(currentveh, vehx, +50, vehz);
I want the vehicle to go up but i dont know how to do it?

Ok i found the problem it was simple
i just needed to add vehy+15 so it works but that would make it go backwards not UP
So i added +15 to vehz and then it was vehz+15 and i changed the +50 to vehy
And it works perfectly

So the working Code is
pawn Код:
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(currentveh, vehx, vehy, vehz);
SetVehiclePos(currentveh, vehx, vehy, vehz+15);



Re: Vehicle JumpFunction - JaTochNietDan - 27.12.2010

Simply increase the z position by how far you want them to go into the sky.

pawn Код:
new currentveh = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(currentveh, vehx, vehy, vehz);
SetVehiclePos(currentveh, vehx, vehy, vehz + 50);



Re: Vehicle JumpFunction - park4bmx - 27.12.2010

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Simply increase the z position by how far you want them to go into the sky.

pawn Код:
new currentveh = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(currentveh, vehx, vehy, vehz);
SetVehiclePos(currentveh, vehx, vehy, vehz + 50);
Oll kool thanks i figured it out two but still thanks dude


Re: Vehicle JumpFunction - iggy1 - 27.12.2010

You know if you want a real vehicle jump and not one that teleports you, you should use these two functions. (its the same logic increase z)

https://sampwiki.blast.hk/wiki/GetVehicleVelocity
https://sampwiki.blast.hk/wiki/SetVehicleVelocity