Hi
i have problem here in
round_think this code check if zombie or human won or dead (spectate) to end the round .. but when zombie or human disconnect (this mean zombie or human == 0 ) the round does not end
myb is there two way to check it ... as i think !
1) check evry teams when becom 0
2) check it in client_disconnect function
Can I find a particular example of this or myb other ways ..?
game: valve
PHP Code:
set_task(0.1, " round_think")
........
.....
public round_think(){
static mins; mins = roundtime/60
static secs; secs = roundtime-mins*60
set_hudmessage(0, 255, 0, -1.0, 0.30, 0, 6.0, 12.0)
show_hudmessage(0, "%d:%.2d",mins,secs) // help me pls
roundtime--
if(!g_zombies&&infection){
round_end(2)
return PLUGIN_CONTINUE
}else if(!g_humans){
round_end(1)
return PLUGIN_CONTINUE
}
if(roundtime)
set_task(1.0,"round_think")
else
round_end(0)
return PLUGIN_CONTINUE
}
public round_end(wins){
g_zombies = 0
g_humans = 0
infection = false
set_hudmessage(255, 255, 212, -1.0, 0.30, 0, 6.0, 12.0)
switch(wins){
case 0: show_hudmessage(0,"Round Draw")
case 1: show_hudmessage(0,"Zombies wins!)
case 2: show_hudmessage(0,"Humans wins!")
}
set_task(5.0,"round_start")
}
__________________