Money Timer
#6

Try using

Код:
for(new a, b = GetMaxPlayers(); a < b; a++)
Instead of

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
The top one is faster and eats less resources.

MAX_PLAYERS has a static value of 500.
GetMaxPlayers(); has a dynamic value of the server max players (set in your server.cfg).

So it's a waste looping through 500 people if there is only 10 online.
You can also try using IsPlayerConnected, but I think the script would have to go through each player and check if their connected, which would be slow.
Reply


Messages In This Thread
Money Timer - by Sajtos - 22.03.2010, 18:38
Re: Money Timer - by MrLeNy - 22.03.2010, 18:42
Re: Money Timer - by MaykoX - 22.03.2010, 18:43
Re: Money Timer - by Correlli - 22.03.2010, 18:45
Re: Money Timer - by Sajtos - 23.03.2010, 15:49
Re: Money Timer - by Joe_ - 23.03.2010, 16:15
Re: Money Timer - by ColdXX - 23.03.2010, 16:36
Re: Money Timer - by Joe_ - 23.03.2010, 16:37
Re: Money Timer - by ColdXX - 23.03.2010, 16:40
Re: Money Timer - by Joe_ - 23.03.2010, 16:41

Forum Jump:


Users browsing this thread: 1 Guest(s)