[Help] Getting cordinates behind of a vehicle
#1

Can anyone help me to get a cordinates behind a vehicle such as a tow truck....
for making the tow truck towable....
Reply
#2

any help?
Reply
#3

pawn Код:
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
Y += -1*(floatcos(-A, degrees));
X += (floatsin(A, degrees));
This should get the x and y behind you. If it doesn't work, try this

pawn Код:
X += (0.75 * floatsin(A, degrees));
Y += (0.75 * floatcos(A, degrees));
I was experimenting with these some time ago and forgot which is the correct one. If neither work, here's the original code which gets the x and y infront of you
pawn Код:
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
Edit it for your demands
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)