I want to get number of alive terrorists, so is code like that would be correct? (you may watch just first 7 lines)
PHP Code:
public cmd_box(id) {
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) {
new players[32], numT
get_players( players, numT, "ae", "TERRORIST" )
if(numT <= 2 && numT > 1 && !g_BoxStarted) {
static i
for(i = 1; i <= g_max_clients; i++)
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
set_user_health(i, 100)
boxon = true
set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
g_BoxStarted = true
set_hudmessage(0, 255, 0, 0.08, 0.24, 2, 2.0, 6.0, 0.05, 0.2, 2)
new name[33]; get_user_name(id, name, charsmax(name))
ShowSyncHudMsg(0, g_HudSync, "Priziuretojas %s Ijunge BOKSO rezima!", name)
}
else {
set_hudmessage(255, 0, 0, 0.08, 0.24, 2, 2.0, 6.0, 0.05, 0.2, 2)
ShowSyncHudMsg(id, g_HudSync, "Ijungti BOKSO rezimo dabar negalima!")
}
}
return PLUGIN_HANDLED
}