Code:
for (new i = 1; i <= get_maxplayers(); i++)
Replace get_maxplayers() with a global variable like so:
Code:
new g_MaxPlayers;
public plugin_init() {
g_MaxPlayers = get_maxplayers();
}
And then put that into the loop instead.
For more info go to:
http://wiki.amxmodx.org/index.php/Optimizing_Plugins
Also, you might want to check if the user is connected:
Code:
if(!is_user_connected(i)) continue;
That will skip the current iteration in the loop. Alternatively you can use get_players, as it's more efficient.
__________________