new LoopTimer; LoopTimer = SetTimerEx("LoopTunnel", 100, true, "");
forward LoopTunnel(); public LoopTunnel() { for(new Objects; Objects < 20; Objects++) { new Float:X = -38; CreateObject(13666, X, 2492, 30, 0, 0, 0); Objects++; X += 5; if(Objects == 20) { KillTimer(LoopTimer); break; } else continue; } }
Originally Posted by _TeRmiNaToR_
I made a object loop for create 20 objects but with this command created one object.
![]() Код:
new LoopTimer; LoopTimer = SetTimerEx("LoopTunnel", 100, true, ""); Код:
forward LoopTunnel(); public LoopTunnel() { for(new Objects; Objects < 20; Objects++) { new Float:X = -38; CreateObject(13666, X, 2492, 30, 0, 0, 0); Objects++; X += 5; if(Objects == 20) { KillTimer(LoopTimer); break; } else continue; } } |
forward LoopTunnel(); public LoopTunnel() { new Float:X = -38;// create X before the loop for(new Objects; Objects < 20; Objects++) { //new Float:X = -38; //you create and set X at each step of loop. CreateObject(13666, X, 2492, 30, 0, 0, 0); Objects++; X += 5; if(Objects == 20) { KillTimer(LoopTimer); break; } else continue; } }
Originally Posted by Joe Staff
Then use a correct object ID, the problem with your function is that you're creating all 20 objects in the same spot, so you won't notice the difference.
|