29.06.2012, 21:29
pawn Код:
new
CountTimer,
CountState;
if (strcmp(cmdtext, "/count", true) == 0)
{
if (CountState != 0)
{
return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}KLAIDA{FFFFFF}: Skaiиiavimas jau pradлtas");
}
CountTimer = SetTimer("StartCD", 1000, true);
CountState = 3;
return true;
}
forward StartCD();
public StartCD()
{
for (new i; i < MAX_PLAYERS; i++)
{
if (!IsPlayerConnected(i)) continue;
if (count[i]) continue;
if (CountState > 0)
{
new szResult[40];
format(szResult, 40, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~%d", CountState - 1);
GameTextForAll(szResult, 1000, 5);
PlayerPlaySound(i, 1056, 0, 0, 0);
-- CountState;
}
else
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~~g~PIRMYN!", 1000, 5);
PlayerPlaySound(i, 1057, 0, 0, 0);
KillTimer(CountTimer);
}
}
return true;
}