AttachObjectToVehicle and absolute position - 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: AttachObjectToVehicle and absolute position (
/showthread.php?tid=426246)
AttachObjectToVehicle and absolute position -
Jorg22 - 28.03.2013
Hi.
I want to attach object to vehicle but with aboslute position of object.
For example:
I create object
Код:
objectid = CreateObject(50, x, y, z, rx, ry, rz, DEFAULT_OBJECT_DRAW_DISTANCE);
then
Код:
AttachObjectToVehicle(objectid, vehicleid, vehx-x, vehy-y, vehz-z, 0, 0, -rz);
But object change his default position.
I want to object stay in same position if vehicle stay.
I need to know how calculate offset from vehicle.
Thanks.
Re: AttachObjectToVehicle and absolute position -
TheArcher - 28.03.2013
This may help you.
https://sampwiki.blast.hk/wiki/GetVehicleModelInfo
Re: AttachObjectToVehicle and absolute position -
Jorg22 - 28.03.2013
Thank you, but i don't think it helped me.
I need to calculate offset from center of vehicle. And i know how to get position of center of vehicle:
Код:
GetVehiclePos(vehicleid, vehx, vehy, vehz);
It gives me center of vehicle? Or am i wrong?
Re: AttachObjectToVehicle and absolute position -
iHaze. - 28.03.2013
Why don't you try Hold Studio? I think it may help you.
Re: AttachObjectToVehicle and absolute position -
Jorg22 - 28.03.2013
SA-MP has something better than Hold studio.
https://sampwiki.blast.hk/wiki/EditAttachedObject
But its for objects attached on players. And i don't need editor. I need somehow use:
https://sampwiki.blast.hk/wiki/EditObject
and then attach object to vehicle, with the same position.
Did you understand?
Thanks.
Re: AttachObjectToVehicle and absolute position -
Jorg22 - 28.03.2013
Nobody?