Facing Angle
#1

How to work GetPlayerFacingAngle(playerid, &Float:ang)


like this??

pawn Code:
if(GetPlayerFacingAngle(playerid, 11.89370441))
would that work? if not how to work it?
Reply
#2

Yes it does
Reply
#3

Quote:
Originally Posted by KennethRandall
View Post
Yes it does
now I think your just posting for post count -_-

It don't work like that because I get this

Code:
error 035: argument type mismatch (argument 2)
Reply
#4

The second param needs a float var, to save the angle of the player in it.
Sorry, for bad english So you do:

Code:
new Float:fangle;
GetPlayerFacingangle(playerid,fangle);
Now fangle got the playerid's Facing angle in it.
Reply
#5

When you use GetPlayerFacingAngle you need to do this:

Code:
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
Now angle is the facing angle you have when executing the command.
Now to show a function of using it:


Code:
if(strcmp(cmdtext, "/angle", true), ==0)
{
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
new string[128];
format(string, sizeof(string), "Your facing angle is %d now.", angle);
SendClientMessage(playerid,0xFFFFFFAA,string);
return 1;
}
That's just basically how it works.

Edit: Your post wasn't there when I started writing this r0b, that's why I wrote the same but a little more also.
Reply
#6

GetPlayerFacingAngle works like GetPlayerPos, you enter variables to save in.
Reply
#7

If you want to compare your angle with this 11.89370441

then just use floatcmp(Float: val1, Float: v2)
Reply
#8

lol tehe thanks for the help guys, i changed to something else though thanks for giving it a try!
Reply
#9

i think you were looking for something like this:
pawn Code:
new Float:Angle;
    GetPlayerFacingAngle(playerid, Angle);
    if(Angle >= 11 && Angle <= 13)
    {
        // Do shit if angle is between 11 and 13
    }
Reply
#10

Kinda got the impression that you didn't get any straight answer to your question, so i answered^^
Reply
#11

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
i think you were looking for something like this:
pawn Код:
new Float:Angle;
    GetPlayerFacingAngle(playerid, Angle);
    if(13>Angle>11)
    {
        // Do shit if angle is between 11 and 13
    }
What about this?
Reply
#12

lol yes xD thanks
Reply
#13

Quote:
Originally Posted by _[HuN]_Epsilon_
Посмотреть сообщение
What about this?
That would check if angle is over 13
Reply
#14

Quote:
Originally Posted by Kar
View Post
hey. nice useful post. l2stfu

ontopic: msg me on xfire no problem
Yeye, I like you too, but ye I don't care about you, does there exists something like GetPlayerFacingAngle(playerid, < max_la <|| max_ra >)

la = left angle
ra = right angle
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)