The angles are weird
#1

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;

Reply
#2

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 **
Reply
#3

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

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
Reply
#5

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

Solved my problem thank you Sjn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)