AttachObjectToObject - 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: AttachObjectToObject (
/showthread.php?tid=266490)
AttachObjectToObject -
letters - 05.07.2011
The title says all. Is it posible? I can't find it (I saw a topic but it asking for it too and no answer).
Re: AttachObjectToObject -
Bakr - 05.07.2011
It's not a native function, but yes, it's possible.
Just set the object on an offset to another. When the object moves (MoveObject), do the same with the other, just applying the same offsets to the destination. Same to be done with SetObjectPos.
Re: AttachObjectToObject -
letters - 05.07.2011
What about the object is attached to another object? So it will be Object -> Object -> Object.
Or the object is moved by explosion or something.
It's kinda hard to make but still posible I guess.
Re: AttachObjectToObject -
Bakr - 05.07.2011
Then just make the object offset of the third object double that of what it was for the second (first attached) object.
As far as them moved without the script doing so, like a player knocking into it, the only solution I could think of is making a timer that would constantly check the original object's position, and to re-apply the offset of the following objects.
Re: AttachObjectToObject -
letters - 05.07.2011
Wow that would be a timer spam.
Re: AttachObjectToObject -
Bakr - 05.07.2011
You wouldn't need a tiny interval timer. I don't think anyone would die seeing the object slightly off of the other for 5 seconds. And a 5 second timer is hardly considered spam, even a 1 second timer.
Re: AttachObjectToObject -
letters - 05.07.2011
I guess I have a better idea.
Thanks to'