AttachObjectToVehicle and absolute position
#1

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.
Reply
#2

This may help you.

https://sampwiki.blast.hk/wiki/GetVehicleModelInfo
Reply
#3

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?
Reply
#4

Why don't you try Hold Studio? I think it may help you.
Reply
#5

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.
Reply
#6

Nobody?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)