SA-MP Forums Archive
CreateExplosion - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CreateExplosion (/showthread.php?tid=185587)



CreateExplosion - Andy_McKinley - 25.10.2010

hi

it doesn't work!

Код:
public Nuke()
{
	for(new i=0; i < 50; i++)
	{
		if(IsPlayerConnected(i))
		{
			new Float:X,Float:Y,Float:Z;
			GetPlayerPos(i,X,Y,Z);
			CreateExplosion(X,Y,Z,7,500000000000);
			CreateExplosion(X,Y,Z,6,5000);
			CreateExplosion(X,Y,Z,3,5000);
			CreateExplosion(X,Y,Z,7,500000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,500000000000000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,500000000);
			CreateExplosion(X,Y,Z,7,50000000000);
			CreateExplosion(X,Y,Z,7,1);
			CreateExplosion(X,Y,Z,7,1);
			CreateExplosion(X,Y,Z,7,100000000000);
			CreateExplosion(X,Y,Z,7,100000000000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,100000000000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,100000000000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			CreateExplosion(X,Y,Z,7,5000);
			SetTimer("Nend",5000,0);
			SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!");
			TextDrawHideForAll(nuke);
		}
	}
	return 1;
}



Re: CreateExplosion - rbN. - 25.10.2010

I can't help you with it, only I geuss it's something to do with the 5000 and stuff..

By the way, the only thing that I'm telling you:

SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!"); --> If 20 players are in the server, the message will be shown 20 times for everybody. It's the best to set the message before return 1, since the loop ends there..


Re: CreateExplosion - Andy_McKinley - 25.10.2010

Quote:
Originally Posted by RobinOwnz
Посмотреть сообщение
SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!"); --> If 20 players are in the server, the message will be shown 20 times for everybody. It's the best to set the message before return 1, since the loop ends there..
This is true! But it is before return 1.


Re: CreateExplosion - Bogdanovic - 25.10.2010

SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!"); ...work?


Re: CreateExplosion - Andy_McKinley - 25.10.2010

Quote:
Originally Posted by Bogdanovic
Посмотреть сообщение
SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!"); ...work?
Yes, it works. The explosion are not working properly...


Re: CreateExplosion - Slice - 25.10.2010

"it doesn't work"

Try to explain what happens, at least.


Re: CreateExplosion - Andy_McKinley - 25.10.2010

Quote:
Originally Posted by g_aSlice
Посмотреть сообщение
"it doesn't work"

Try to explain what happens, at least.
I think I made a mistake. I made this nuke for players with 20 killstreak, i accidental set it to 30... My bad


Re: CreateExplosion - Sinner - 25.10.2010

Код:
			SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!");
			TextDrawHideForAll(nuke);
		}
	}
	return 1;
= laggfest, it will send 20 messages for 50 loops = 1000 messages
place it outside the for loop