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:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Found here:
https://sampwiki.blast.hk/wiki/Function#...ultiple_values