SetVehicleZAngle - My script's fault or sa:mp's bug? - 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: SetVehicleZAngle - My script's fault or sa:mp's bug? (
/showthread.php?tid=261730)
SetVehicleZAngle - My script's fault or sa:mp's bug? -
WooTFTW - 14.06.2011
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?
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
Scenario - 14.06.2011
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.
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
WooTFTW - 14.06.2011
Quote:
Originally Posted by RealCop228
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?
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
Scenario - 14.06.2011
Quote:
Originally Posted by Skorch
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.
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
WooTFTW - 14.06.2011
Quote:
Originally Posted by RealCop228
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
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
Scenario - 14.06.2011
Quote:
Originally Posted by Skorch
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.
Re: SetVehicleZAngle - My script's fault or sa:mp's bug? -
Jack_Rocker - 14.06.2011
Samp bug i believe