01.02.2010, 16:40
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 :
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?

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;
}
In any script i make, loop "For" don't work, even from code taked on the forum.
Any idears?