26.02.2011, 15:21
It wont spam the timer function. It will only execute the code between the brackets of the loop.
Though you should move the SendClientMessageToAll function out of the loop, because it will send loads of times.
Why are you using a loop anyway? Can't you just use TextDrawShowForAll and a loop in the SpawnThePlayer timer? Aswell as GameTextForAll?
Though you should move the SendClientMessageToAll function out of the loop, because it will send loads of times.
pawn Код:
public GameEnd2()
{
new string[128];
format(string, sizeof(string), "Next map: {A52A2A}%s", GetMapName());
for(new i=0; i < MAX_PLAYERS; i++)
{
TextDrawShowForPlayer(i, Textdraw0);
TextDrawShowForPlayer(i, Textdraw1); // 1
TextDrawShowForPlayer(i, Textdraw2); // 2
TextDrawShowForPlayer(i, Textdraw3); // 3
TextDrawShowForPlayer(i, Textdraw4); // 4
TextDrawShowForPlayer(i, Textdraw5); // 5
TextDrawShowForPlayer(i, Textdraw6);
TextDrawShowForPlayer(i, Textdraw7);
TextDrawShowForPlayer(i, Textdraw8);
TextDrawShowForPlayer(i, Textdraw9);
TextDrawShowForPlayer(i, Textdraw10);
TextDrawShowForPlayer(i, Textdraw11);
TextDrawShowForPlayer(i, Textdraw12);
TextDrawShowForPlayer(i, Textdraw13);
TextDrawShowForPlayer(i, Textdraw14);
TextDrawShowForPlayer(i, Textdraw15);
TextDrawShowForPlayer(i, Textdraw16);
TextDrawShowForPlayer(i, Textdraw17);
TextDrawShowForPlayer(i, Textdraw18);
TextDrawShowForPlayer(i, Textdraw19);
GameTextForPlayer(i, "~b~Game ended!~n~ ~r~Time's up", 5000, 3);
SetTimerEx("SpawnThePlayer", 10000, false, "i", i);
}
SendClientMessageToAll(COLOR_YELLOW, string);
SetTimer("NextMap", 10000, false);
return 1;
}