Raised This Month: $ Target: $400
 0% 

TeamLock 5v5? Errors 3 and 4 help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hectik17
AlliedModders Donor
Join Date: Oct 2005
Old 04-10-2017 , 11:46   Re: TeamLock ratio? Subbs make match restart help
Reply With Quote #2

Any help would be apriciated so close to working

Code:
Update:
PHP Code:
public round_end()
{
    if(
g_rounds >= get_pcvar_num(g_match_rounds))
    {
        
set_cvar_num("fmatch_ratio"10)
        
server_cmd("sv_restart");
    }
    {
        
check_teams();
    }

this testing on 1v1 humans wa working , but dont know yet if the server will handle 10 players, the other method was caussing a overflow on the console

also

PHP Code:
public round_start()
{
    if(!
get_pcvar_num(g_cvar_enable))
        return;
    
    new 
ratio clamp(get_pcvar_num(g_cvar_ratio), 1floatround(Float:(g_iMaxplayers/2.0), floatround_floor))
    new 
cnumtnumplayers[32];
    
get_players(playerscnum"he""CT")
    
get_players(playerstnum"he""TERRORIST")
    if((
ratio*2) > (cnum+tnum))
    {
        
check_teams();
        return;
    }
    else if(!((
ratio == cnum) && (ratio == tnum)))
    {
        
//server_cmd("sv_restart 3")
    
}
    
    
check_ratio()
    
    
// counting rounds..
    
g_rounds++;

This is what i think is causing a subbed player (a player that has swapped places with a player in a current match) make the game restart/reset rounds before its time to swap.

so i just blocked it out //
but not sure if it will affect anything else.
So far it was not restarting the game when team check happens at the start of the round, before it would restart game if teams are unbalanced an round checked at the start of every round.

Last edited by Hectik17; 04-10-2017 at 13:18.
Hectik17 is offline
 



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 17:47.


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