PDA

View Full Version : Deathmatch Team Balancer


dubbeh
07-18-2007, 01:57
Deathmatch Team Balancer v1.0.0.4

Simple team balancer plugin for CS:S Deathmatch (mp_autoteambalance breaks in Deathmatch) :wink:

Server Console Vars:
dmtb_enable "1" // Enable the Deathmatch Team Balancer
dmtb_checktime "30.0" // How often to check if the teams are balanced - min = 30 (30 seconds) max = 600 (10 mins)
dmtb_playerlimit "2" // How uneven the teams can get before getting balanced - Min = 1 Max = 32
dmtb_adminsimmune "1" // Enable admins immunity from getting switched 1 = on / 0 = off

Install:
dmtb.smx -> addons\sourcemod\plugins
dmtb.sp -> addons\sourcemod\scripting
plugin.dmtb.cfg -> cfg\sourcemod

Version History:
v1.0.0.4
- Fixed a few bugs with GetUserAdmin
- Little less overhead on the code
v1.0.0.33
- Fixed any possible bugs with MaxClients & the reserved slots plugin
- Added checks to swap dead players first
v1.0.0.32
- Added an admin immunity option
v1.0.0.31
- Reverted the previous change
- Fixed a small bug with the max clients checking
v1.0.0.3
- Balance bug should finally be fixed - thanks to 1694 for the bug reports
v1.0.0.2
- Few more checks added to the code
v1.0.0.1
- Couple of internal code changes

Thanks to oxymoron for the main idea & all the diffrent code examples on the forums from various plugin authors :)

have fun dubbeh

xYx
07-18-2007, 07:02
lo,

your a yegod!!

Thanks for doing this, ill test it when im home!!

Cheers

xYx aka Oxymoron

xYx
07-18-2007, 07:05
could you post up the cfg cvars so i can read them in the forum plz?

I cant download at work

dubbeh
07-18-2007, 07:47
nps, posted up the cVar list

only thing i havn't got done yet is the auto assign option

xYx
07-18-2007, 18:16
I am very thankful for this plugin. I might have found a little bug though.

I have default settings. The server was 8 CTs v 6 Ts. The plugin noticed this and switched it to 6 CTs v 8 Ts.

I understand that i have dmtb_playerlimit "2" but should it not make it 7 v 7 or infact leave the teams as they were & not switch anyone?

Am I making any sense?

cheers

1695
07-19-2007, 04:34
luv' u !!!!!!!!!!!!!!!!!!!!!!!!! After year of waiting for that, U DID IT ! lol thx !

dubbeh
07-19-2007, 07:46
nps :mrgreen:

xYx that bug should be fixed now :)

xYx
07-19-2007, 10:45
is this the most up to date version:

dmtb_1000.zip (13.0 KB, 1 views) ?

dubbeh
07-19-2007, 11:12
yeah, taken the plugin out of beta

Craftkiller
07-19-2007, 17:59
Any chance you could release the source code?

L. Duke
07-19-2007, 18:31
Any chance you could release the source code?

I believe the SourceMod license requires all plugins to make their source code available. It's in the download file.

Craftkiller
07-19-2007, 21:00
oh thank you, other ones have a seperate download link for source so I figured thats the only place itd be.

dubbeh
07-20-2007, 03:43
Sourcecode can be found in the "addons\sourcemod\scripting" folder

Think its illegal to release a plugin without the sourcecode under the GPL, unless u get special rights from the author

1695
08-08-2007, 03:06
Seems that it doesn't wok for me ! 3 vs 1 and... nothing ever happen !? help ?

CSSDM 2.00 Final

dubbeh
08-08-2007, 13:42
Just out of curiosity what was the cvar dmtb_playerlimit set to?

1695
08-08-2007, 13:52
dmtb_playerlimit 2 (default)

dubbeh
08-08-2007, 18:04
Tryed a few internal code changes

can you test this out & see if it works correctly now

thanks

1695
08-09-2007, 05:34
currently trying... Will keep you informed.

EDIT : Seems to be working now ! thx !
EDIT2 : Worked only ONE time :s...

dubbeh
08-09-2007, 20:15
Added a few more checks to the code - hopefully that will fix the bug

1695
08-10-2007, 04:27
Currently testing again...

EDIT : Erf, waiting a loooong time and still 4 vs 2...

dubbeh
08-10-2007, 05:03
the balance bug should finally be fixed now - might cause the teams might get swapped around a bit more

thanks for the bug reports :)

1695
08-10-2007, 05:07
Currently Testing lol, feed back soon.

EDIT : Ah, become interesting. We were "1T vs 3CTs". Plugin detected that and swap... 2 persons -_-' so were were "3Ts vs 1CT". A least, plugin did something ^^.

dubbeh
08-10-2007, 05:41
thought that would happen xD

this version should 100% work, didn't check max clients correctly - can't see anything that would cause a problem

if your still having problems - try setting dmtb_playerlimit "1" & see if the bug still happens

1695
08-10-2007, 05:52
Okay, testing now

EDIT : Okay, seems to be working this time ! At the begining i was afraid since one player was swapepd and swapped again evry 30 sec, but it appear that he was swapping team manually (he seemed to hate being CTs :p), at least I think it was that since it finally stoped...

thx for your quick answering, [add karma] (=> erf can't ^^)

FEATURE REQUEST :

Swap Immunity - admin immunity to swap

dubbeh
08-10-2007, 07:16
Admin immunity feature added in the latest version :)

1695
08-10-2007, 07:20
you rocks ! ^^

1695
08-10-2007, 16:34
Another suggestion : could the plugin swap dead player if possible ? I mean, I have cssdm_respawn_wait "3.50" sec, so it would be better if player were swap while dead (no suicide in stats). If you could add this variable :

dmtb_prefere_dead 1|0 // prefere dead player to swap, only active if cssdm_respawn_wait > 2 to avoid problem

Are something like that... don't know if that is possible.
cssdm_respawn_wait > "2" should not be "necessary" but much easy with that.

=========================

also, I never been swaped, so i was wondering if they were any obvious waring for the people who is swaped ? I mean more than the little "player xxxx joined the Cts forces" ? Because sometimes they seemes to not understand while they were swapped :p.

bye

1695
08-12-2007, 04:21
topic is going down and down... so i up it expecting you, dubbeh, to see it :D

dubbeh
08-12-2007, 09:51
Only swapping dead clients can be done with the IsPlayerAlive & storing alive/dead players on each team then giving them swap priority

Adding the swap message will be really easy to add

I'll see what i can come up :) - having a little coding break atm

1695
08-12-2007, 11:15
Okay cool. take your time.

1695
08-17-2007, 03:12
up ! :p nothing new here ?

dubbeh
08-17-2007, 05:12
Been a little bit busy over the past few days with an AFK Manager ;)

dubbeh
08-17-2007, 08:07
Done a quick update to swap dead players first & fixed a couple of bugs with the reserved slots plugin

J@y-R
08-25-2007, 22:45
hello

I have find this in my sourcemod logs!!!

L 08/25/2007 - 19:49:36: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 08/25/2007 - 19:49:36: [SM] Displaying call stack trace for plugin "dmtb.smx":
L 08/25/2007 - 19:49:36: [SM] [0] Line 174, /home/groups/alliedmodders/forums/files/2/9/2/1/8/19199.attach::TeamBalanceThread()
L 08/25/2007 - 19:49:41: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 08/25/2007 - 19:49:41: [SM] Displaying call stack trace for plugin "dmtb.smx":
L 08/25/2007 - 19:49:41: [SM] [0] Line 174, /home/groups/alliedmodders/forums/files/2/9/2/1/8/19199.attach::TeamBalanceThread()
L 08/25/2007 - 19:49:46: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 08/25/2007 - 19:49:46: [SM] Displaying call stack trace for plugin "dmtb.smx":
L 08/25/2007 - 19:49:46: [SM] [0] Line 174, /home/groups/alliedmodders/forums/files/2/9/2/1/8/19199.attach::TeamBalanceThread()
L 08/25/2007 - 19:49:51: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 08/25/2007 - 19:49:51: [SM] Displaying call stack trace for plugin "dmtb.smx":
L 08/25/2007 - 19:49:51: [SM] [0] Line 174, /home/groups/alliedmodders/forums/files/2/9/2/1/8/19199.attach::TeamBalanceThread()
L 08/25/2007 - 20:01:56: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 08/25/2007 - 20:01:56: [SM] Displaying call stack trace for plugin "dmtb.smx":
L 08/25/2007 - 20:01:56: [SM] [0] Line 174, /home/groups/alliedmodders/forums/files/2/9/2/1/8/19199.attach::TeamBalanceThread()


wfg JaY

dubbeh
08-26-2007, 03:14
Thanks for the bug report

Fixed this in v1.0.0.4 :)

tftpapst
01-26-2008, 02:20
Doesent work anymore. No Teambalance at any time
SM Version 1864
CSS DM 2.10
Linux

StevenT
01-30-2008, 21:06
Doesent work anymore. No Teambalance at any time
SM Version 1864
CSS DM 2.10
Linux

confirming for Empires mod, not working, same SM version

Box Cutter
04-02-2008, 18:57
dubbeh, any plans to update this plugin, or is it dead? I would love to run but it sounds like it is no longer working?

DontWannaName
04-02-2008, 21:06
Needs to be moved to unapproved then. :(

J@y-R
04-23-2008, 06:59
Come on a littel bit update !!!!
works not anymore in game

dubbeh come on pls

Greetz
JaY

Box Cutter
05-22-2008, 15:36
Can anyone confirm if this is still working? Previous posts state it is not, but stats show servers are running it.

-BC

Gladiator69
06-11-2008, 08:01
Hello, does it works for Day of defeat source?

sphinx
09-24-2008, 01:33
is this pluging dead?

dubbeh
09-24-2008, 16:00
Nope ;)

Quick note to everyone trying this with other mods, this was only made to fix the mp_autoteambalance bug in CS:S with the rounds never ending. It's untested in other mods but a chance it will work

Blogge
10-01-2008, 11:37
How do I download this? I cant see any download links (im new to this place so I am quite nooby).

Box Cutter
10-01-2008, 12:49
How do I download this? I cant see any download links (im new to this place so I am quite nooby).


http://forums.alliedmods.net/showpost.php?p=504735&postcount=1

zepper
11-23-2009, 22:12
it seems to work TNX

Raptor10
03-11-2010, 13:21
Sry for a stupid question but I need an answer:

my server is setted as follow:
Sourcemod 1.2.4
Gungame5+Deathmatch (Eventescripts)
This nice plugin works anyway or needs GG+DM made for Sourcemod ?

thanks

geshev69
01-23-2011, 12:21
Does this plugin works for orangebox? Please someone to update it

Heartless 1.0
03-01-2011, 10:33
Does this plugin swap players on death?

Molli
03-01-2011, 11:47
Does this plugin swap players on death?

Yep.

dbs1989
06-25-2011, 13:15
What is the Admin flag to get imune? if there is one.
I have admin and members on my server, i want Members to get TeamBalance imune to, but they DONT have Basis Admin

Blacksilver
01-11-2013, 15:44
Player get switch will there are alive :D
CT with T model and CT with T model not really funny :o


if (!IsPlayerAlive (i) && !IsProtectedAdmin (i))


You have the check but ... i dont know ^^

Root_
01-05-2014, 13:33
Once I made similar plugin. If this one is not working, you can try my version. Requires colors from this post (https://forums.alliedmods.net/showpost.php?p=2051486&postcount=373)for compilation