08.09.2012, 20:08
pawn Код:
public OnGameModeInit()
{
SetTimer("OnlinePlayersAnnounce", 600000, 1);
return 1;
}
forward OnlinePlayersAnnounce();
public OnlinePlayersAnnounce()
{
new playersOnlineString[30];
format(playersOnlineString, sizeof(playersOnlineString), "Online players: %d", GetTotalPlayerCount());
SendClientMessageToAll(-1, playersOnlineString);
return 1;
}
GetTotalPlayerCount()
{
new playerCount;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
playerCount++;
}
}
return playerCount;
}