Try
PHP Code:
public client_disconnect(id)
{
if(!g_bRoundEnd)
static szName[32], randomplayer
new new_terr = players[random(pnum)]
if(fnGetTeamPlayers(1) == 1){
cs_set_user_team(new_terr, CS_TEAM_T);
get_user_name(new_terr, szName, 31 ); // get the name
client_print(0,print_chat,"The last TT left, %s is the new TT",szName); // advertise which player
ExecuteHamB(Ham_CS_RoundRespawn, new_terr); // respawn the new last player
}
}
fnGetTeamPlayers(team) {
static i, iPls;
for (i = 0; i < g_iMaxpl; i++){
if (is_user_connected(i)){
switch(team){
case 1:if (cs_get_user_team(i) == CS_TEAM_T) iPls++;
case 2:if (cs_get_user_team(i) == CS_TEAM_CT) iPls++;
}
}
}
return iPls;
}
__________________