SA-MP Forums Archive
SetPlayerFacingAngle -> Fail? - 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: SetPlayerFacingAngle -> Fail? (/showthread.php?tid=447292)



SetPlayerFacingAngle -> Fail? - Saize - 29.06.2013

Hey dudes, Iґm scripting a FS, and i wanna change my positions to variables, like y+1 z+6 ...
Its all good, but It dont changes my FacingAngle

PHP код:
CMD:mypos(playeridparams[])
{
        new 
pidpos[POSDATA];
        new 
pfreeze;
        if(!
sscanf(params,"ffffd",pidpos[PPX],pidpos[PPY],pidpos[PPZ],pidpos[PFA], pfreeze))
        {
                new 
Float:tmppos[POSDATA];
                
GetPlayerPos(playerid,tmppos[PPX],tmppos[PPY],tmppos[PPZ]);
                
GetPlayerFacingAngle(playerid,pidpos[PFA]);
                
SetPlayerPos(playeridpidpos[PPX] + tmppos[PPX],pidpos[PPY] + tmppos[PPY], pidpos[PPZ] + tmppos[PPZ]);
                
SetPlayerFacingAngle(playerid,pidpos[PFA] + tmppos[PFA]);
                
SetCameraBehindPlayer(playerid);
                if(
pfreeze == 0TogglePlayerControllable(playerid,1);
                else 
TogglePlayerControllable(playerid,0);
        }
        else 
SendClientMessage(playerid0xFFFFFFFF,"{FFFFFF}Usage:{B0000C} /mypos [X] [Y] [Z] [FacingAngle] [Freeze (0 No | 1 Yes)]");
        return 
1;




AW: SetPlayerFacingAngle -> Fail? - Nero_3D - 29.06.2013

pawn Код:
GetPlayerPos(playerid,tmppos[PPX],tmppos[PPY],tmppos[PPZ]);
GetPlayerFacingAngle(playerid,pidpos[PFA]); // check this line again

SetPlayerPos(playerid, pidpos[PPX] + tmppos[PPX],pidpos[PPY] + tmppos[PPY], pidpos[PPZ] + tmppos[PPZ]);
SetPlayerFacingAngle(playerid,pidpos[PFA] + tmppos[PFA]);



AW: SetPlayerFacingAngle -> Fail? - Saize - 29.06.2013

Found it....


GetPlayerFacingAngle(playerid,tmppos[PFA]); is the right code