SA-MP Forums Archive
vehicle pos offset Q - 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: vehicle pos offset Q (/showthread.php?tid=180976)



vehicle pos offset Q - thomas.. - 03.10.2010

okay, so for offsets would it be


float ect
getvehpos(x,y,z);
createobject(....

but can someone give me the offsets for behind a vehicle about +15?

cause i try again and again but i keep getting the xyz mixed up, i even have it ******d to help me but it doesnt! D:


Re: vehicle pos offset Q - Rachael - 03.10.2010

pawn Код:
#define OBJECT_ID //your object here

new Float:angle,Float:vx,Float:vy,Float:vz;
GetVehiclePos(vehicleid,vx,vy,vz);
GetVehicleZAngle(vehicleid,angle);
CreateObject(OBJECT_ID,vx + (-15 * floatsin(360-angle,degrees)),vy + (-15 * floatcos(360-angle,degrees)),vz,0.0,0.0,angle);
untested, but it should give you a starting point.


Re: vehicle pos offset Q - thomas.. - 03.10.2010

Quote:
Originally Posted by Rachael
Посмотреть сообщение
pawn Код:
#define OBJECT_ID //your object here

new Float:angle,Float:vx,Float:vy,Float:vz;
GetVehiclePos(vehicleid,vx,vy,vz);
GetVehicleZAngle(vehicleid,angle);
CreateObject(OBJECT_ID,vx + (-15 * floatsin(360-angle,degrees)),vy + (-15 * floatcos(360-angle,degrees)),vz,0.0,0.0,angle);
untested, but it should give you a starting point.
thanks alot