[Help]Angle - 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: [Help]Angle (
/showthread.php?tid=519170)
[Help]Angle -
PowerF - 13.06.2014
how to know angle?
Re: [Help]Angle -
Mriss - 13.06.2014
https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
Re: [Help]Angle -
Lynn - 13.06.2014
What Angle, there are alot.
To know the players, it's GetPlayerFacingAngle(); To get a cars it's GetVehicleZAngle();
Re: [Help]Angle -
nmader - 13.06.2014
When you are in a vehicle, you should use
pawn Код:
GetVehicleZAngle(vehicleid);
When you are on foot you should use
pawn Код:
GetPlayerFacingAngle(playerid);
If you are wanting to get the opposite facing angle (such as behind you or to your side) you can always use simple math:
pawn Код:
new Float:angle = GetPlayerFacingAngle(playerid)-90.0;
It is important to note that when you get these values they are placed as a float, so you should use them when appropriate. If you need/want to make them an integer use
pawn Код:
floatround(angle); //Or whatever float variable you want to be made into an integer