If the function worked properly then that would obviously be the fastest and easiest way. The problem is that passing flags with get_players() does not always return valid results; I tested the function with various flags and got mixed results. On one occassion, passing "ae" to the function would return players as normal (alive,team) then the next day, identical plugin\code, it would always return 0 players even though there were players that matched the passed criteria. The function should not be used with flags if it is not always going to work consistently. This is why I called it with no flags and did the alive\team checking manually.
http://www.amxmodx.org/funcwiki.php?go=func&id=174
Quote:
|
"We don't really support get_players() with flags anymore. It was a bad idea and if it was our choice, it would have never been added to the original AMX Mod." - BAILOPAN
|
And that code is incorrect, untested
PHP Code:
new iPlayers[32] , iT;
get_players( iPlayers , iT , "ae" , "TERRORIST" );
if ( iT == 1 )
{
menu_handler( iPlayers[0] , menu, item);
}
else
{
client_print( iPlayers[0] , print_chat , "You cannot use that command." );
}
__________________