SA-MP Forums Archive
[Help] Getting cordinates behind of a vehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Getting cordinates behind of a vehicle (/showthread.php?tid=98939)



[Help] Getting cordinates behind of a vehicle - silvan - 24.09.2009

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


Re: [Help] Getting cordinates behind of a vehicle - silvan - 05.10.2009

any help?



Re: [Help] Getting cordinates behind of a vehicle - dice7 - 05.10.2009

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