02.01.2012, 19:27
You're looping (up to) 15 times per second through 100 players, and that for every player. Remove that .. thing from OnPlayerUpdate.
Here's a really simple fix. 10 seconds should be more than enough.
Here's a really simple fix. 10 seconds should be more than enough.
pawn Code:
// OnGameModeInit
SetTimer("UpdatePlayerCount", 10000, false);
// OnPlayerSpawn
TextDrawShowForPlayer(playerid, players);
// Note that you don't have to re-show the textdraw if it gets updated.
function UpdatePlayerCount();
public UpdatePlayerCount() {
new
str[ 10 ];
format(str, 10, "%d/100", GetOnLinePlayers());
TextDrawSetString(players, str);
}