Raised This Month: $ Target: $400
 0% 

check client disconnect or team == 0 ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-29-2017 , 12:30   check client disconnect or team == 0 ?
Reply With Quote #1

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 
minsmins roundtime/60
    
static secssecs roundtime-mins*60
    set_hudmessage
(02550, -1.00.3006.012.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
(255255212, -1.00.3006.012.0)
    switch(
wins){
        case 
0show_hudmessage(0,"Round Draw")
        case 
1show_hudmessage(0,"Zombies wins!)
        case 2: show_hudmessage(0,"
Humans wins!")
    }
    
    set_task(5.0,"
round_start")

__________________

Last edited by abdobiskra; 01-30-2017 at 02:38.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode