Quote:
Originally Posted by Exolent[jNr]
PHP Code:
for (new i; i <get_maxplayers(); i++)
Stop doing that!
1. Cache get_maxplayers() in plugin init:
Code:
new g_iMaxPlayers;
public plugin_init( )
{
g_iMaxPlayers = get_maxplayers( );
}
2. Players are 1 to maxplayers, not 0 to maxplayers - 1.
Code:
for( new iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++ )
{
// Player loop
}
Also, your message won't be seen in plugin_end() since the map is changing and it is called right before clients are disconnected and reconnected to the changed map.
|
Doesnt need to make a global g_iMaxPlayers for that
in the plugin
PHP Code:
new iMaxPlayers = get_maxplayers()
for(new i = 1; i <= iMaxPlayers; i++)
{
}
Should be enough, because it only gets "called" once ?
__________________