Raised This Month: $51 Target: $400
 12% 

Team Balancer for DeathMatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 05-28-2007 , 14:21   Team Balancer for DeathMatch
Reply With Quote #1

I tried PTB and it didn't worked and sometimes im playing like 6 vs 4 and the team with surplus doesn't even bother to balance. Is there any plugin available?
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-28-2007 , 14:56   Re: Team Balancer for DeathMatch
Reply With Quote #2

Dunno!I maked this ^^...!

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
 
#define PLUGIN "Simple Team Balance"
#define VERSION "1.0"
#define AUTHOR "Alka"

public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 register_event("HLTV", "_new_round", "a", "1=0", "2=0");

}
 
public _new_round()
{
 
 new tplayers[32], ctplayers[32], tnum, ctnum;
 
 get_players(tplayers, tnum, "e", "TERRORIST");
 get_players(ctplayers, ctnum, "e", "CT");
 
 if(tnum > ctnum)
 {
      cs_set_user_team(tplayers[0], CS_TEAM_CT);
      spawn(tplayers[0]);
 }
 
 else {
  
      cs_set_user_team(ctplayers[1], CS_TEAM_T);
      spawn(ctplayers[1]);
 }
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 05-28-2007 , 15:06   Re: Team Balancer for DeathMatch
Reply With Quote #3

Quote:
public _new_round()
it will not work cos in deathmatch there aren't new rounds most of the times only at the beginning.

it has to be on player respawn and the team has to be balanced preferebly without starting a new round

Last edited by Juba_PornBorn; 05-28-2007 at 15:10.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-28-2007 , 15:14   Re: Team Balancer for DeathMatch
Reply With Quote #4

Oh...you'r right,i forgot! I'm trying to change...;)

EDIT:
Try This:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
 
#define PLUGIN "Simple Team Balance"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 register_event("DeathMsg", "_Death_Msg", "a")
 
}
 
public _Death_Msg()
{
 
 new victim = read_data(2)
 
 new tplayers[32], ctplayers[32], tnum, ctnum;
 
 get_players(tplayers, tnum, "e", "TERRORIST");
 get_players(ctplayers, ctnum, "e", "CT");
 
 if(tnum > ctnum)
 {
      cs_set_user_team(victim, CS_TEAM_CT);
      spawn(victim);
 }
 
 else {
  
      cs_set_user_team(victim, CS_TEAM_T);
      spawn(victim);
 }
}
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-29-2007 at 10:04.
Alka is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-04-2007 , 04:07   Re: Team Balancer for DeathMatch
Reply With Quote #5

There's a situation where there are 5 to 4 players or 6 to 5 example and a player that died will change team until team is ct=t wich is not very pleasant and may be confusing. Is that situation predicted? A good way to fix it is to set if ct != t by +2 players then victim respawns T or if -2 respawns CT

Last edited by Juba_PornBorn; 06-04-2007 at 04:13.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-04-2007 , 17:19   Re: Team Balancer for DeathMatch
Reply With Quote #6

Changed it a little....should work now.
Credits go to alka!

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun>   #define PLUGIN "Simple Team Balance" #define VERSION "1.0" #define AUTHOR "Alka"   public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_event("DeathMsg", "_Death_Msg", "a") } public _Death_Msg() {     new victim = read_data(2)     new tplayers[32], ctplayers[32], tnum, ctnum;     get_players(tplayers, tnum, "e", "TERRORIST");     get_players(ctplayers, ctnum, "e", "CT");     if(tnum - 1 > ctnum)     {         cs_set_user_team(victim, CS_TEAM_CT);         spawn(victim);         set_task(0.5,"spawnagain",victim);     }     else if(tnum < ctnum - 1)     {         cs_set_user_team(victim, CS_TEAM_T);         spawn(victim);         set_task(0.5, "spawnagain", victim);     } } public spawnagain(id) {     spawn(id); }

greetz regalis
__________________

Last edited by regalis; 06-04-2007 at 17:45.
regalis is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-04-2007 , 18:04   Re: Team Balancer for DeathMatch
Reply With Quote #7

Alka now publish this has a new plugin has it is indespensable even for non-deathmach games and for it's simplicity working.
It works perfect with the regalis changes.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-05-2007 , 09:53   Re: Team Balancer for DeathMatch
Reply With Quote #8

heh , gj regalis ...sorry Juba but i don't saw you posted! ...
Quote:
Originally Posted by Juba_PornBorn
Alka now publish this has a new plugin has it is indespensable even for non-deathmach games and for it's simplicity working.
Hum...dunno! You think so...?
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-05-2007 , 14:40   Re: Team Balancer for DeathMatch
Reply With Quote #9

Yep! Do you know any team balancer for deathmatch? And this is so simple and efective.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-05-2007 , 14:43   Re: Team Balancer for DeathMatch
Reply With Quote #10

;) i think i will post this,but you have more ideas for implementing in this plugin?
__________________
Still...lovin' . Connor noob! Hello
Alka 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 10:31.


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