SA-MP Forums Archive
The angles are weird - 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)
+--- Thread: The angles are weird (/showthread.php?tid=589121)



The angles are weird - saffierr - 15.09.2015

Somehow all of my teleports are not the way I want it.

The facing Angle are not the way I want them to face.
It's always a random Angle they're facing at.
Help would be really appreciated

one of my tps :

PHP код:
CMD:drivingschool(playeridparams[])
{
   new 
Float:Angle;
   
GetPlayerFacingAngle(playeridAngle);
   
SetPlayerFacingAngle(playerid180);
   
SetPlayerPos(playerid, -2026.2877,-78.2901,35.3203);
   
SendClientMessage(playeridCOLOR_YELLOW"You are teleported to the drivingschool!");
   return 
1;




Re: The angles are weird - khRamin78 - 15.09.2015

PHP код:
CMD:drivingschool(playeridparams[])
{
   new 
Float:Angle
   
GetPlayerFacingAngle(playeridAngle); // Why You Are Getting This ? where you use it ?
   
SetPlayerFacingAngle(playerid180); // 180 ? FacingAngle Is Float 180.0 but just use /save and get your facing angle from there so it will be where you want
   
SetPlayerPos(playerid, -2026.2877,-78.2901,35.3203);
// Note : Put SetPlayerFacing Angle After SetPlayerPos
   
SendClientMessage(playeridCOLOR_YELLOW"You are teleported to the drivingschool!");
   return 
1;

Please Answer my Up Question's Also

** Put SetPlayerFacingAngle After SetPlayerPos **


Re: The angles are weird - karemmahmed22 - 15.09.2015

PHP код:
 new Float:Angle
   
SetPlayerPos(playerid, -2026.2877,-78.2901,35.3203); 
   
GetPlayerFacingAngle(playeridAngle);
   
SetPlayerFacingAngle(playeridAngle 180); 



Re: The angles are weird - saffierr - 15.09.2015

Aaight, thanks, I did 180 because I tried everything lol so I just left it on 180 since nothing solved my problem.

PHP код:
CMD:drivingschool(playeridparams[])
{
   
SetPlayerPos(playerid, -2026.2877,-78.2901,35.3203);
   
SetPlayerFacingAngle(playerid181.8009);
   
SendClientMessage(playeridCOLOR_YELLOW"You are teleported to the drivingschool!");
   return 
1;

Doesn't work also


Re: The angles are weird - Sjn - 15.09.2015

Use /save to get the coordinate of the player you want to teleport to. It gives the facing angle coordinate as well. Also, i know there's another problem with SetPlayerPos, like the camera of the player doesn't stay at the same position, so i'd recommend you to use SetCameraBehindPlayer(playerid); function right after setting the player's position.


Re: The angles are weird - saffierr - 15.09.2015

Solved my problem thank you Sjn.