Is possible get attached dynamic object position? -
3417512908 - 23.08.2018
Is possible it?For vehicle object.
Anybody have some way to do that?
Re: Is possible get attached dynamic object position? -
Sew_Sumi - 23.08.2018
How do you mean?
If you're wanting to do lights/things added to them, spawn a car in Jernejls map editor (
https://sampforum.blast.hk/showthread.php?tid=282801), place it at 0,0,0 with 0,0,0 rotation, then any object you place on that vehicle, in that position/rotation is where it attaches to the car.
Because the car is 0,0,0, with 0,0,0, any objects coords/rotations are what is to be attached to the car.
Players/skins are a whole other ball game as they have bones to be attached to.
The other way to really do it, is by using the callback OnPlayerEditDynamicObject (if using streamer) or OnPlayerEditObject (If using natives), but again, that has a lot to it.
Re: Is possible get attached dynamic object position? -
NaS - 23.08.2018
If you want to get an attached object's position/offset, the offset and rotation is stored by the streamer and you can access it by Streamer_GetFloatData:
Код:
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_OFFSET_X, x);
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_OFFSET_Y, y);
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_OFFSET_Z, z);
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_RX, rx);
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_RY, ry);
Streamer_GetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_RZ, rz);
If you use it frequently I'd suggest to write a function for it instead of pasting these 6 lines everywhere.