SetVehicleZAngle - My script's fault or sa:mp's bug?
#1

pawn Code:
public OnVehicleSpawn(vehicleid)
{
     SetVehicleZAngle(vehicleid, CarInfo[vehicleid][oPos][3]);
     printf("Spawn Angle:%f", CarInfo[vehicleid][oPos][3]);
     new Float:a;
     GetVehicleZAngle(vehicleid, a);
     printf( "Physical angle: %f", a);
}
How comes they print different values?
Note: CarInfo[vehicleid][oPos][3] = 91

Spawn angle prints 91
but Physical angle prints 179.
How comes?
Reply
#2

I believe this is a known bug. A lot of times when vehicles are re-spawned their Z angle gets messed up- causing them to spin in weird directions other than the way they really should be.
Reply
#3

Quote:
Originally Posted by RealCop228
View Post
I believe this is a known bug. A lot of times when vehicles are re-spawned their Z angle gets messed up- causing them to spin in weird directions other than the way they really should be.
Is there any known fix for this?
Maybe an timer? What do you think?
Reply
#4

Quote:
Originally Posted by Skorch
View Post
Is there any known fix for this?
Maybe an timer? What do you think?
I'm not really sure. You could try to reset the Z angle once the vehicle is spawned, other than that I have no idea.
Reply
#5

Quote:
Originally Posted by RealCop228
View Post
I'm not really sure. You could try to reset the Z angle once the vehicle is spawned, other than that I have no idea.
I'll try to put 50ms timer. Basically it will run the timer under OnVehicleSpawn and then when the timer is executed, it will set the right angle. I will give it a try
Reply
#6

Quote:
Originally Posted by Skorch
View Post
I'll try to put 50ms timer. Basically it will run the timer under OnVehicleSpawn and then when the timer is executed, it will set the right angle. I will give it a try
It's worth a shot.
Reply
#7

Samp bug i believe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)