Posts: 162
Threads: 37
Joined: Feb 2017
Reputation:
0
Okay guys, I know that timer use much more memory, so I want to replace it by 'gettime', but the problem is I don't know how to use it. Something like the player /healme and then waiting for 10 seconds, the player can /healme again.
Posts: 1,266
Threads: 6
Joined: Oct 2014
PHP код:
new p_LastHealMe[MAX_PLAYERS]; // to save time in it
PHP код:
CMD:healme(playerid, params[])
{
if(( gettime() - p_LastHealMe[playerid] ) < 10)
{
// error message
}
else
{
// stuff
p_LastHealMe[playerid] = gettime();
}
}
Posts: 1,266
Threads: 6
Joined: Oct 2014
Can you show your codes under this loop? When you send a lot of data to player's game this would occur....
Posts: 294
Threads: 12
Joined: Sep 2015
Reputation:
0
gettime is like GetTickCount and is lot better than SetTimerEx
Posts: 6,242
Threads: 8
Joined: Jun 2008
Foreach should be better.
Where did you find GetPlayerMaxPoolSize? That's not even on the wiki, and GetPlayerPoolSize seems to be what you should be using.