How can I get the x y z pos of the BACK/FRONT of something?
#2

Get the X and Y 2 units in front of a player:
Код:
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
x += floatsin(-a, degrees) * 2.0;
y += floatcos(-a, degrees) * 2.0;
Get the X and Y 2 units behind a player:
Код:
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
a = a < 180.0 ? a + 180.0 : a - 180.0;
x += floatsin(-a, degrees) * 2.0;
y += floatcos(-a, degrees) * 2.0;
Reply


Messages In This Thread
How can I get the x y z pos of the BACK/FRONT of something? - by aKnoxx - 03.01.2019, 11:29
Re: How can I get the x y z pos of the BACK/FRONT of something? - by BeckzyBoi - 03.01.2019, 12:01

Forum Jump:


Users browsing this thread: 1 Guest(s)