SA-MP Forums Archive
GetPlayerFacingAngle help - 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: GetPlayerFacingAngle help (/showthread.php?tid=244357)



GetPlayerFacingAngle help - grand.Theft.Otto - 27.03.2011

I just tried GetPlayerFacingAngle for my /loc command (locates a player and where they are) but I thought I should add directions like North, East, South and West. For the example for GetPlayerFacingAngle on the wiki, the code is this:

pawn Код:
new Float:Angle, string[26];
GetPlayerFacingAngle(playerid, Angle);
format(string, sizeof(string), "Your facing angle: %0.2f", Angle);
SendClientMessage(playerid, 0xFFFFFFFF, string);
%0.2f = the direction in numbers

Instead of it showing me the directions in numbers, how can I get it to show (North), (East), (South), and (West) instead of like for example (200.91) etc...


Re: GetPlayerFacingAngle help - antonio112 - 27.03.2011

Don`t know if this is the best idea ... but it`s 'stolen' from a 'fly' command.

First, you`ll have to determine yourself what facing angles are north, south, east and west.

Then, you can use:

pawn Код:
if(Angle >= 0.0 && Angle<= 22.5)
    SendClientMessage(playerid, -1, "Your facing angle North");
This is just an example ...