Raised This Month: $ Target: $400
 0% 

Team Ratio 1:3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
superang
Senior Member
Join Date: Apr 2009
Location: Portugal
Old 12-18-2009 , 12:11   Team Ratio 1:3
Reply With Quote #1

Team Ratio 1, to 1ct 3ter.
But also block the initial choose team menu.
Can anyone do it, i need it soo much :S

Code:
//----------------------------------------- 
//INCLUDES 
//----------------------------------------- 
#include <amxmodx> 
#include <cstrike> 

//----------------------------------------- 
//CONSTANTS 
//----------------------------------------- 
#define PLUGIN "Ratio" 
#define VERSION "1.0" 
#define AUTHOR "MrOpposite" 

//----------------------------------------- 
//GLOBAL VARS 
//----------------------------------------- 
new      int:g_team[32] = int:CS_TEAM_UNASSIGNED;  // 
new      g_ct = 0; 
new      g_t  = 0; 

//----------------------------------------- 
//INIT FUNCTION 
//----------------------------------------- 
public plugin_init() 
{ 
    register_plugin(PLUGIN,VERSION,AUTHOR) //I created this :P 
    register_event( "TeamInfo", "Event_TeamChange", "a"); 
} 

public client_connect(id) 
{ 
    g_team[id] = int:CS_TEAM_UNASSIGNED; 
} 

public client_disconnect(id) 
{ 
    if(g_team[id] == int:CS_TEAM_CT) 
    { 
        g_ct -= 1; 
    } 
    else if(g_team[id] == int:CS_TEAM_T) 
    { 
        g_t  -= 1; 
    } 
    g_team[id] = int:CS_TEAM_UNASSIGNED; 
} 

//----------------------------------------- 
//When a player switches team. 
//----------------------------------------- 
public Event_TeamChange(id) 
{ 
    if(int:cs_get_user_team(id) == g_team[id]) 
    { 
        return PLUGIN_HANDLED; 
    } 
    if(g_team[id] == int:CS_TEAM_CT) 
    { 
        g_ct -= 1; 
    } 
    else if(g_team[id] == int:CS_TEAM_T) 
    { 
        g_t  -= 1; 
    } 
     
    if(cs_get_user_team(id) == CS_TEAM_CT) 
    { 
        g_ct += 1; 
    } 
    else if(cs_get_user_team(id) == CS_TEAM_T) 
    { 
        g_t  += 1; 
    } 
    new tar_ct = g_ct; 
    new tar_t  = g_t ; 
    new players; 
    new tmp[32]; 
    new ratio; 
    get_players(tmp,players); 
    if(players > 2) 
    { 
        ratio = floatround((Float:tar_ct/(Float:tar_ct + Float:tar_t)*100)) 
        if(ratio < 33) 
        { 
            while(ratio < 33) 
            { 
                tar_ct += 1; 
                tar_t  -= 1; 
                ratio = floatround((Float:tar_ct/(Float:tar_ct + Float:tar_t)*100)) 
            } 
            tar_ct -= 1; 
            tar_t  += 1; 
        } 
        else if(ratio > 33) 
        { 
            while(ratio > 33) 
            { 
                tar_ct -= 1; 
                tar_t  += 1; 
                ratio = floatround((Float:tar_ct/(Float:tar_ct + Float:tar_t)*100)) 
            } 
            tar_ct += 1; 
            tar_t  -= 1; 
        } 
        else 
        { 
            return PLUGIN_HANDLED; 
        } 
        for(new i; i < players && (g_ct != tar_ct || g_t != tar_t); i++) 
        { 
            if(cs_get_user_team(id) == CS_TEAM_CT) 
            { 
                if(g_ct > tar_ct) 
                { 
                    cs_set_user_team(tmp[i], CS_TEAM_T); 
                    g_ct -= 1; 
                    g_t  += 1; 
                    g_team[tmp[i]] = int:CS_TEAM_T; 
                } 
            } 
            else if(cs_get_user_team(id) == CS_TEAM_T) 
            { 
                if(g_t > tar_t) 
                { 
                    cs_set_user_team(tmp[i], CS_TEAM_CT); 
                    g_ct += 1; 
                    g_t  -= 1; 
                    g_team[tmp[i]] = int:CS_TEAM_CT; 
                } 
            } 
        } 
         
    } 
    return PLUGIN_CONTINUE; 
}  
I have this one, but it doesn't work.
__________________

Last edited by superang; 12-18-2009 at 12:17.
superang is offline
Send a message via MSN to superang
izzle
Senior Member
Join Date: Aug 2009
Old 12-18-2009 , 13:08   Re: Team Ratio 1:3
Reply With Quote #2

why not use http://forums.alliedmods.net/showthread.php?t=69819
__________________
izzle is offline
BlackAndEvil
Member
Join Date: Dec 2009
Old 12-18-2009 , 13:15   Re: Team Ratio 1:3
Reply With Quote #3

Team Join Management - join all people to one team.
but in mode like JailBreak you need Team Ratio Per terror 3 Ct's
cus with
Team Join Management all join to terror and only admin can move players to ct
the problem it's the admin is not online all the day so we need Team Ratio 1

BlackAndEvil is offline
superang
Senior Member
Join Date: Apr 2009
Location: Portugal
Old 12-18-2009 , 13:24   Re: Team Ratio 1:3
Reply With Quote #4

Quote:
Originally Posted by izzle View Post
izzle I'm using that plugin right now, but i prefer ratio plugin, because exolent's plugin when is 10T vs 4CT , moves ppl only to ct and that sucks!
__________________
superang is offline
Send a message via MSN to superang
Dark-Skript
BANNED
Join Date: Jun 2009
Location: 127.0.0.1 <3
Old 12-20-2009 , 08:51   Re: Team Ratio 1:3
Reply With Quote #5

Please help me too all i need is for my jail 1 1 ct to 3 t or 1:4: 2:5 2:6 I realy need help...
Dark-Skript is offline
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-20-2009 , 09:06   Re: Team Ratio 1:3
Reply With Quote #6

superang a question from my side and a little example that happens on ratio 1 with autojoin.

well, jailbreak is a gameplay were it is needed to talk via voice, isnt it ?

some players havent a headset nor microphone and cant talk via voice, dont they ?

now with a team ratio 1 plugin or whatever they are supposed to autojoin teams.

now u have 9 players in terrorist team and 3 in ct team. but those 3 in ct team havnt the ability to use vocom.

so whats happend now ? right an admin have to change players who have the ability to speek via voice.

a ratio is good for Deathrun servers or other gameplay mods were its not needed to speek via voice.

its just a question for me for a better understanding.
platzpatrone is offline
Dark-Skript
BANNED
Join Date: Jun 2009
Location: 127.0.0.1 <3
Old 12-20-2009 , 09:10   Re: Team Ratio 1:3
Reply With Quote #7

A lot of the time their are more cts than t and they just go round freekilling the ts so atleast if the ratio is better their is more chance of the case of the freekillers not being as bad..
Dark-Skript is offline
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-20-2009 , 09:12   Re: Team Ratio 1:3
Reply With Quote #8

Quote:
Originally Posted by Dark-Skript View Post
A lot of the time their are more cts than t and they just go round freekilling the ts so atleast if the ratio is better their is more chance of the case of the freekillers not being as bad..
voteban for freekillers. we using a modified voteban that if the voteban starter has abuse it he will be banned then. it prevents abusing
and there is a timelimit that voteban cant start that often.

tell me how u can play jailberak without voice ?
platzpatrone is offline
Dark-Skript
BANNED
Join Date: Jun 2009
Location: 127.0.0.1 <3
Old 12-20-2009 , 09:20   Re: Team Ratio 1:3
Reply With Quote #9

You cant unless you give commands by text which sucks
Dark-Skript is offline
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-20-2009 , 09:25   Re: Team Ratio 1:3
Reply With Quote #10

yeah and a better way to do a similar thing is to check the players
calculate it and just give out a hud warning message like

"There are X Counters too much, please go X Counter to Terrorists"

or like

"There are X Counter too less, please go X Terrorist to Counter"



to prevent freekillers then use voteban. other ways dont work (ex. Admins )
platzpatrone 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 00:14.


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