Quote:
Originally Posted by ot_207
PHP Code:
new players[32],num,id get_players(players, num)
new count_t, count_ct
for (new i=0;i<num;i++) { switch (cs_get_user_team(players[i])) { case CS_TEAM_T: count_t++; case CS_TEAM_CT: count_ct++; }
client_print(0, print_chat, "TERO: %d", count_t) client_print(0, print_chat, "CT: %d", count_ct) }
|
Just 2 minor typo's:
- client_print's are within the loop - I can't tell if this was intended because of the indentation (or lack, thereof)
- variable id is never used
PHP Code:
new players[32] , num
get_players(players, num)
new count_t, count_ct
for (new i=0;i<num;i++)
{
switch (cs_get_user_team(players[i]))
{
case CS_TEAM_T: count_t++;
case CS_TEAM_CT: count_ct++;
}
}
client_print(0, print_chat, "TERO: %d", count_t)
client_print(0, print_chat, "CT: %d", count_ct)
Another way to do this:
get_players() is no longer supported and is a bit buggy depending on which flags you use.
See this
link.
PHP Code:
new iPlayers[ 32 ];
new iPlayerCount;
get_players ( iPlayers , iPlayerCount , "e" , "TERRORIST" );
client_print( 0 , print_chat , "Terrorist: %d" , iPlayerCount );
get_players ( iPlayers , iPlayerCount , "e" , "CT" );
client_print( 0 , print_chat , "CT: %d" , iPlayerCount );
__________________