Velocity change problem
#1

I'm now trying to change vehicle velocity (for example from X=1.5 Y=-2 Z=0 to X=-1.5 Y=2 Z=0), but it doesn't work properly... Sometimes it works fine (if the velocity X and Y is higher than 0), but on few directions the velocity doesn't change or my vehicle 'flies' to diffrent ways (not behind me or ahead, but on the left or right). The code I'm using:

Code:
new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z);

if(X >= 0)
{
      X = -X;
}
if(Y >= 0)
{
      Y = -Y;
}
if(Z >= 0)
{
      Z = -Z;
}

SetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z);
I hope someone will find what's wrong here and help me
Reply


Messages In This Thread
Velocity change problem - by Libra_PL - 21.08.2011, 15:01
Re: Velocity change problem - by veyron - 21.08.2011, 15:17
Re: Velocity change problem - by Babul - 21.08.2011, 15:19
Re: Velocity change problem - by Libra_PL - 21.08.2011, 16:01

Forum Jump:


Users browsing this thread: 2 Guest(s)