[SOLVED] CPU Usage increases with more houses defined
#2

I would say that this is the main problem:
Quote:
Originally Posted by KnooL
pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)
{
  Timer[0] = SetTimerEx("ReadPlayerHouseData", 1000, true, "%i", i);
}
If your MAX_PLAYERS is defined as 500 (by default at a_samp.inc) then there's no wonder that your CPU is crying. 500 timers.. that's not good.
Use one timer for all players (SetTimer function).
Also, you should use < MAX_PLAYERS instead of <= MAX_PLAYERS in the player loops or just use the foreach from ******.
Also, you can't use "%i" in SetTimerEx, use just "i"
Reply


Messages In This Thread
[SOLVED] CPU Usage increases with more houses defined - by KnooL - 10.01.2010, 01:19
Re: CPU Usage increases with more houses defined - by Correlli - 10.01.2010, 01:22
Re: CPU Usage increases with more houses defined - by introzen - 10.01.2010, 01:28
Re: CPU Usage increases with more houses defined - by KnooL - 10.01.2010, 01:43
Re: [SOLVED] CPU Usage increases with more houses defined - by Donny_k - 10.01.2010, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)