Velocity - 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: Velocity (
/showthread.php?tid=501933)
Velocity -
Hanuman - 21.03.2014
Is there a anyway to increase the velocity of car while driving by adding the velocity? If u can't understand then take this like, I want to fit 10 nitro boost in every vehicle!
Re: Velocity -
MythicalMarauder - 21.03.2014
What the hell?
Re: Velocity -
Aerotactics - 21.03.2014
https://sampwiki.blast.hk/wiki/SetPlayerVelocity
Re: Velocity -
Hanuman - 21.03.2014
Quote:
Originally Posted by Aerotactics
|
The problem is i don't know how to find the direction of vehicle in which it is running.
If I add x+0.1 or y+0.1 or z+0.1 then it won't go straight everytime. And By the way, i want to increase vehicle velocity not Player velocity.
EDIT: I think that it will be possible by GetVehicleZAngle, but idk how.
Re: Velocity -
Aerotactics - 21.03.2014
https://sampwiki.blast.hk/wiki/SetVehicleVelocity
The Y-value is forward.
Re: Velocity -
Hanuman - 21.03.2014
Let me check.
EDIT: Not working
Re: Velocity -
newbienoob - 21.03.2014
pawn Код:
new Float:vx, Float:vy, Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx*2, vy*2, vz*2);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
//change 2 to speed that you want.
Re: Velocity -
Aerotactics - 21.03.2014
Код:
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx*2, vy*2, vz*2);
Why are you multiplying each variable by 2? Variable Y is forward momentum.
Re: Velocity -
Hanuman - 21.03.2014
Thanks Newbienoob
+Rep!
Re: Velocity -
cessil - 21.03.2014
no Y is north/south X is east/west and z is up and down