SA-MP Forums Archive
SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - 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: SetVehicleZAngle Returning Backwards Coords (Possible to flip?) (/showthread.php?tid=448978)



SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - notshowbiz - 06.07.2013

Alright this seems like a fairly common issue so I don't think I need to spatter out ALL my coding for it.

I'm storing GetVehicleZAngle in the database, then calling it for SetVehicleZAngle
Upon using SetVehicleZAngle I'm almost 100% certain it's just flipping the stored coordinates in the exact opposite direction. I guess a way to work around this would be to flip the coords into the opposite direction upon executing it with SetVehicleZAngle, or saving the SetVehicleZAngle so how exactly would I go about doing that?

If anyone else has another working option, please supply.


Re: SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - iggy1 - 06.07.2013

Well if you add 180 degrees that should be a U-Turn.

EDIT: Still it would be better if you find out whats making it store backwards angles and fix it proper.


Re: SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - Konstantinos - 06.07.2013

It's weird though, when I get and set the ZAngle, it flips to the correct way. Make sure that you do not have anything else which cause it from being set to a different way.


Re: SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - notshowbiz - 06.07.2013

Unfortunately after adding (Coords+180) the result is a constant south-aimed spawn.
I've dug up and read all over the forum about retrieving Z angles causing backwards spawning.
It's all receiving and storing properly, just ass backwards.


edit: I've even gone as far as to PutPlayerInVehicle and then set the Z Angle, still nothing.


Re: SetVehicleZAngle Returning Backwards Coords (Possible to flip?) - notshowbiz - 06.07.2013

185.527786 is the coordinate getting saved in the database
Because the angle is being set to face north by default, I'm assuming it's breaking at SetVehicleZAngle, even though I'm forcing the database to recover the 185 directly before using, it's getting stuck on 0 or something when actually being executed.

Edit:
I'm working on some further patching and troubleshooting to see if it persists, so far no luck.
(I'm not a newb scripter, just stuck in a rut, may solve myself, will keep posted)