GetPlayerFacingAngle help
#1

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...
Reply
#2

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 ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)