His way: 32 loop iterations, 8 native calls per (for alive\connected\team\bot checking, twice)
get_players: No excess iterations and no other natives.
His code can be optimized a bit, and FYI, if you are ever checking if connected AND alive, just check if alive because that includes a connected check.
PHP Code:
new g_iMaxPlayers;
g_iMaxPlayers = get_maxplayers();
for ( new i = 1 ; i <= g_iMaxPlayers ; i++ )
{
if ( !is_user_alive( i ) || is_user_bot( i ) )
continue;
switch ( get_user_team( i ) )
{
case CS_TEAM_T:
{
}
case CS_TEAM_CT:
{
}
}
}
__________________