Facing 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Facing Angle (
/showthread.php?tid=165845)
Facing Angle -
willsuckformoney - 06.08.2010
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?
Re: Facing Angle -
KennethRandall - 06.08.2010
Yes it does
Re: Facing Angle -
willsuckformoney - 06.08.2010
Quote:
Originally Posted by KennethRandall
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)
Re: Facing Angle -
r0b - 06.08.2010
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.
Re: Facing Angle -
Mystique - 06.08.2010
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.
Re: Facing Angle -
Hiddos - 06.08.2010
GetPlayerFacingAngle works like GetPlayerPos, you enter variables to save in.
Re: Facing Angle -
RyDeR` - 06.08.2010
If you want to compare your angle with this 11.89370441
then just use floatcmp(Float: val1, Float: v2)
Re: Facing Angle -
willsuckformoney - 06.08.2010
lol tehe thanks for the help guys, i changed to something else though thanks for giving it a try!
Re: Facing Angle -
Cameltoe - 06.08.2010
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
}
Re: Facing Angle -
Cameltoe - 06.08.2010
Kinda got the impression that you didn't get any straight answer to your question, so

i answered^^
Re: Facing Angle -
_[HuN]_Epsilon_ - 06.08.2010
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?
Re: Facing Angle -
willsuckformoney - 06.08.2010
lol yes xD thanks
Re: Facing Angle -
Cameltoe - 06.08.2010
Quote:
Originally Posted by _[HuN]_Epsilon_
What about this?
|
That would check if angle is over 13
Re: Facing Angle -
KennethRandall - 06.08.2010
Quote:
Originally Posted by Kar
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