SA-MP Forums Archive
HOW TO GET 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: HOW TO GET FACING ANGLE? (/showthread.php?tid=111347)



HOW TO GET FACING ANGLE? - buonggiorno - 01.12.2009

I want to make spawn point for player is not from my country. so here is how that need to look

Code:
SetPlayerPos(playerid,477.8121,-1499.7649,20.5001);
				SetPlayerFacingAngle(playerid, 262.9963);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
One thing i dont know and that is how to get facing angle? any help? tnx alot


Re: HOW TO GET FACING ANGLE? - Correlli - 01.12.2009

https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle


Re: HOW TO GET FACING ANGLE? - buonggiorno - 01.12.2009

i see that but this numbers make me confused.

272.3543 that is face angle but i dont know how to get decimals ?


Re: HOW TO GET FACING ANGLE? - Mechscape - 01.12.2009

That is Cord.

You should learn that match's.



Like: 0.0 , 30.0 , 90.0 , 180.0 , 270.0 ....

Code:
SetPlayerFacingAngle(playerid, 0.0);



Re: HOW TO GET FACING ANGLE? - Dreftas - 01.12.2009

Quote:
Originally Posted by buonggiorno
i see that but this numbers make me confused.

272.3543 that is face angle but i dont know how to get decimals ?
pawn Code:
stock floatval(Float:var)
{
    new str[32];
    format(str, sizeof(str), "%f", var);
    return strval(str);
}
And then you can do smth like this:
pawn Code:
new Float:bla = 465.84562;
format(string,128,"Float %f in decimals is %d",bla,floatval(bla));
You get "Float 465.84562 in decimals is 465".




Re: HOW TO GET FACING ANGLE? - buonggiorno - 01.12.2009

ohhhh ok i cathc it tnx a lot i done this


Re: HOW TO GET FACING ANGLE? - Correlli - 01.12.2009

Quote:
Originally Posted by Dreft
pawn Code:
stock floatval(Float:var)
{
    new str[32];
    format(str, sizeof(str), "%f", var);
    return strval(str);
}
Use this - https://sampwiki.blast.hk/wiki/Floatround


Re: HOW TO GET FACING ANGLE? - Dreftas - 01.12.2009

Quote:
Originally Posted by Don Correlli
Sure, floatround() is a good idea too

I prefer floatval()


Re: HOW TO GET FACING ANGLE? - Correlli - 01.12.2009

Quote:
Originally Posted by Dreft
I prefer floatval()
I don't.

I prefer floatround, you can round the float down or up to the nearest integer.