Object moving help - 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: Object moving help (
/showthread.php?tid=514968)
Object moving help -
hhaaoo123 - 24.05.2014
Anyone can help me to move 10 object with 1 cmds?
I can only move 1 object in 1 time. Anyone can help?
Re : Object moving help -
S4t3K - 24.05.2014
Use a loop.
Store all the objectids you want move in an array, then use a for loop to move each object but at the same position.
A loop does the same thing an indiquated number of times.
Re: Object moving help -
SilentSoul - 24.05.2014
Create an array. I'll give you a fast example:
pawn Код:
new Objects[10];
Objects[1] = CreateObject(..);
Objects[2] = CreateObject(..); // An so on create the other objects.
CMD:moveallobjects(playerid, params[])
{
for(new i=0; i < 11; i++) MoveObject(Objects[i],x,y,z,speed,rotx,roty,rotz); //Loop instead of moving every array alone.
return 1;
}
EDIT: Ops, sorry S4t3K.
Re : Object moving help -
S4t3K - 24.05.2014
No problem, you give an example whereas I don't give any.