Vehicle Boost Help - 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 Boost Help (
/showthread.php?tid=188299)
Vehicle Boost Help -
Tim_Ethen - 07.11.2010
I have this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == KEY_FIRE)
{
if (pRank[playerid] > 4) {
new vid, Float:x, Float:y, Float:z, Float:nx, Float:ny;
vid = GetPlayerVehicleID(playerid);
if(vid != 0) {
GetVehicleVelocity(vid, x, y, z);
if(x == 0) nx = x;
else if(x < 0) nx = x - 0.5;
else nx = x + 0.5;
if(y == 0) ny = y;
else if(y < 0) ny = y - 0.5;
else ny = y + 0.5;
SetVehicleVelocity(vid, nx, ny, z);
}
}
}
return 1;
}
This works but only boosts you in the general direction of travel. Can somebody make it so it boost you in exactly the direction of travel.
Re: Vehicle Boost Help -
Th3Angel - 07.11.2010
Use GetVehicleZAngle
Re: Vehicle Boost Help -
Joe Staff - 07.11.2010
Well this is a kind of simple way of putting it but...
pawn Код:
new Float:x,Float:y,Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.5,y*1.5,z*1.5);
Sometimes the simple solution is the best solution
Re: Vehicle Boost Help -
Retardedwolf - 07.11.2010
Vehicle boost for a roleplay server.
Re: Vehicle Boost Help -
Tim_Ethen - 07.11.2010
Multiply Works! Nice and simple.
Yes... For The Admins