SA-MP Forums Archive
Possible to move multiple objects at a time? - 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: Possible to move multiple objects at a time? (/showthread.php?tid=405630)



Possible to move multiple objects at a time? - denNorske - 07.01.2013

Hello!

I am having a small issue, i am going to make a big island, and i don't want that island to be able for others than the owners. And by that, i want to move all the objects which i have mapped, underwater with one single command. Is that possible with not too advanced codes?

Thanks!


Re: Possible to move multiple objects at a time? - davve95 - 07.01.2013

I don't know if its possible with many objects or just some... I don't know if there are any limit..
But you can try:


Id = CreateObject(, X, Y, Z);

And add more with "id " infront of object just.. And define name at the top... Pretty hard to explain xD.. But check the Wiki for more info...


Re: Possible to move multiple objects at a time? - Konstantinos - 07.01.2013

Maybe it is possible by using Iterator. Add any object to Iterator and use foreach.


Re: Possible to move multiple objects at a time? - Vince - 07.01.2013

Use AttachObjectToObject. Attach any object to the parent object. Move parent object.


Re: Possible to move multiple objects at a time? - megamind2067 - 07.01.2013

You may have to use MoveObject (https://sampwiki.blast.hk/wiki/MoveObject) and move every object.

Example use the cmd:

Код:
if (strcmp("/moveobject", cmdtext, true, 10) == 0)
	{
		MoveObject(objectid, x,y,z,object speed);
                MoveObject(objectid, x,y,z,object speed);
                MoveObject(objectid, x,y,z,object speed);
                MoveObject(objectid, x,y,z,object speed);
example>>  MoveObject(18755, 1568.7086,-1691.1489,29.5216,10);
		return 1;
	}