Raised This Month: $ Target: $400
 0% 

add Auto balance with team ratio jailbreak?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kendra
Senior Member
Join Date: Feb 2011
Location: Chile
Old 01-11-2013 , 00:55   add Auto balance with team ratio jailbreak?
Reply With Quote #1

hi i need your help pleace

I have this team ratio to jail break http://forums.alliedmods.net/showpos...95&postcount=4

PHP Code:
#include <amxmodx>
#include <cstrike>

#define MAX_PLAYERS 32

new bool:g_vgui_menus[MAX_PLAYERS 1];

new 
tjr_enabled;
new 
tjr_ratio;

new 
g_max_players;

new 
ShowMenu;

public 
plugin_init()
{
    
register_plugin("Team Join Ratio""0.0.1""Exolent");
    
    
register_clcmd("jointeam""CmdJoinTeam");
    
    
register_menucmd(register_menuid("Team_Select"1), (1<<0|1<<1|1<<4|1<<5|1<<9), "MenuTeamSelect");
    
    
register_menucmd(register_menuid("CT_Select"1), (1<<0|1<<1|1<<2|1<<3||1<<4), "MenuModelSelect");
    
register_menucmd(register_menuid("Terrorist_Select"1), (1<<0|1<<1|1<<2|1<<3||1<<4), "MenuModelSelect");
    
    
register_message(get_user_msgid("VGUIMenu"), "MessageVGUIMenu");
    
    
tjr_enabled register_cvar("tjr_enabled""1");
    
tjr_ratio register_cvar("tjr_ratio""3");
    
    
g_max_players get_maxplayers();
    
    
ShowMenu get_user_msgid("ShowMenu");
}

public 
client_disconnect(id)
{
    
CheckVGUIMenus(id);
}

public 
CmdJoinTeam(id)
{
    if( 
get_pcvar_num(tjr_enabled) )
    {
        new 
arg[11], team;
        
read_argv(1argcharsmax(arg));
        
        if(    
is_str_num(arg)
        &&    
CheckRatio(idstr_to_num(arg)) )
        {
            if( 
team == )
            {
                
engclient_cmd(id"jointeam""1");
            }
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
MenuTeamSelect(idkey)
{
    if(    
get_pcvar_num(tjr_enabled)
    &&    
CheckRatio(id, ++key) )
    {
        if( 
key == )
        {
            new 
block get_msg_block(ShowMenu);
            
set_msg_block(ShowMenuBLOCK_SET);
            
            
engclient_cmd(id"jointeam""1");
            
engclient_cmd(id"joinclass""5");
            
            
set_msg_block(ShowMenublock);
            
            
CheckVGUIMenus(id);
        }
        else
        {
            
engclient_cmd(id"chooseteam");
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    if( 
key == 10 )
    {
        
CheckVGUIMenus(id);
    }
    
    return 
PLUGIN_CONTINUE;
}

bool:CheckRatio(idteam)
{
    if(    (
team == || CsTeams:team == CS_TEAM_CT)
    &&    
cs_get_user_team(id) != CS_TEAM_CT )
    {
        new 
Float:ratio get_pcvar_float(tjr_ratio);
        
        if( 
ratio 0.0 && ratio != 1.0 )
        {
            new 
tct;
            for( new 
1<= g_max_playersi++ )
            {
                if( 
!= id && is_user_connected(i) )
                {
                    switch( 
cs_get_user_team(i) )
                    {
                        case 
CS_TEAM_Tt++;
                        case 
CS_TEAM_CTct++;
                    }
                }
            }
            
            if( 
ct && floatround(ct ratiofloatround_floor) >= float(t) )
            {
                return 
true;
            }
        }
    }
    
    return 
false;
}

public 
MenuModelSelect(idkey)
{
    
CheckVGUIMenus(id);
}

CheckVGUIMenus(id)
{
    if( 
g_vgui_menus[id] )
    {
        
g_vgui_menus[id] = false;
        
        
set_user_info(id"_vgui_menus""1");
    }
}

public 
MessageVGUIMenu(msgiddestid)
{
    if( 
is_user_connected(id) && get_msg_arg_int(1) == )
    {
        
g_vgui_menus[id] = true;
        
        
set_user_info(id"_vgui_menus""0");
        
        
//engclient_cmd(id, "chooseteam");
        
        
set_task(0.1"TaskForceChooseTeam"id);
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
TaskForceChooseTeam(id)
{
    
engclient_cmd(id"chooseteam");
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 

someone could put a autobalance that makes final round.
EX: 9 TR vs 5 CT, Autobalance in the end round -> 11 TR vs 3 CT pleace (


sorry my bad english
kendra is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-11-2013 , 03:25   Re: add Auto balance with team ratio jailbreak?
Reply With Quote #2

idk if it will help you: just search in the plugins made by Exolent[jNr] (approved, or all), I know two one of them doing what you're asking for.
__________________
ANTICHRISTUS is offline
kendra
Senior Member
Join Date: Feb 2011
Location: Chile
Old 01-11-2013 , 03:40   Re: add Auto balance with team ratio jailbreak?
Reply With Quote #3

Quote:
Originally Posted by ANTICHRISTUS View Post
idk if it will help you: just search in the plugins made by Exolent[jNr] (approved, or all), I know two one of them doing what you're asking for.
the autobalance of exolent is made to start the round causing bugs on my server.
you know of any that do autobalance end of the round? please
kendra is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-11-2013 , 04:18   Re: add Auto balance with team ratio jailbreak?
Reply With Quote #4

Quote:
Originally Posted by kendra View Post
you know of any that do autobalance end of the round? please
no, but I suggest you to search only in titles:
Quote:
Originally Posted by ANTICHRISTUS your keywords are in your own request, search only one keyword by time, and in all the sub-forums, one by one.
__________________
ANTICHRISTUS is offline
Reply



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 13:43.


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