[Loop] Weapon-Command problem
#1

Hi

I tried to make a little Command script to create an explosion around the admin.
Problem is : I want to use a loop for it, and it doesn't work.
I don't know any other type of loop, but I dont think there's a problem from using this one.
Just take a look :

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
    {
  if(!strcmp(cmdtext,"/ion",true))
  {
       new Float:x, Float:y, Float:z;

  // Get Player Position
  GetPlayerPos(playerid, x, y, z);
       for(new i=30; i<50; i++)
       {
  // Create an explosion around the Character from all around him 20 times
  CreateExplosion(x+0, y+i, z, 6, 50);
  CreateExplosion(x+i, y+i, z, 6, 50);
  CreateExplosion(x+i, y+0, z, 6, 50);
  CreateExplosion(x+i, y-i, z, 6, 50);
  CreateExplosion(x+0, y-i, z, 6, 50);
  CreateExplosion(x-i, y-i, z, 6, 50);
  CreateExplosion(x-i, y+0, z, 6, 50);
  CreateExplosion(x-i, y+i, z, 6, 50);
 
       return 1;
    }
    return 1;
  }
The result? Only one circle of explosions, instead of 20.
In any script i make, loop "For" don't work, even from code taked on the forum.
Any idears?
Reply


Messages In This Thread
[Loop] Weapon-Command problem - by canard - 01.02.2010, 16:40
Re: [Loop] Weapon-Command problem - by MadeMan - 01.02.2010, 16:48
Re: [Loop] Weapon-Command problem - by canard - 01.02.2010, 16:51
Re: [Loop] Weapon-Command problem - by MadeMan - 01.02.2010, 16:55
Re: [Loop] Weapon-Command problem - by Joe Staff - 01.02.2010, 17:32
Re: [Loop] Weapon-Command problem - by canard - 03.02.2010, 15:24
Re: [Loop] Weapon-Command problem - by MadeMan - 03.02.2010, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)