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



SetPlayerPos - Ectazy - 06.01.2016

Hi guys, how can i check player facing angle (or any other function) and then SetPlayerPos(playerid, x, y(+5 or -5 depending on player facing angle),z);
Thanks for the answer.


Re: SetPlayerPos - justinnater - 06.01.2016

new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);


Re: SetPlayerPos - Vince - 06.01.2016

PHP код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:yFloat:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridxya);
    
GetPlayerFacingAngle(playerida);
    if (
GetPlayerVehicleID(playerid))
    {
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    
+= (distance floatsin(-adegrees));
    
+= (distance floatcos(-adegrees));

Found here: https://sampwiki.blast.hk/wiki/Function#...ultiple_values