SetVehicleVelocity question
#1

hey, is there any way that SetVehicleVelocity function will make the car go in straight line?
iv'e tested this function becouse i wanna use it in my script and when i use it the car is not exactly
going in straight line, its jumping to the sides and not going straight.

Here is my part of code that i use, if you got any idea how to make the car go in straight line i will thank you.

pawn Код:
if(newkeys == KEY_VEHICLE_ACCELERATE)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(PlayerSpeed[playerid] > 120)
            {
                new Float:x, Float:y, Float:z, Float:f, vid;

                vid = GetPlayerVehicleID(playerid);

                GetVehicleZAngle(vid,f);
                GetVehicleVelocity(vid,x, y, z);

                if (x >= 0.0) { x += 0.2; }
                else { x -= 0.2; }

                if (y >= 0.0) { y += 0.2; }
                else { y -= 0.2; }

                SetVehicleVelocity(vid, x, y, z);
                SetVehicleZAngle(vid,f);
            }
        }
    }
Reply


Messages In This Thread
SetVehicleVelocity question - by Yuval_Baruch - 13.03.2011, 13:38
Re: SetVehicleVelocity question - by Yuval_Baruch - 14.03.2011, 12:00
Re: SetVehicleVelocity question - by Joe Staff - 14.03.2011, 12:23
Re: SetVehicleVelocity question - by Yuval_Baruch - 14.03.2011, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)