Raised This Month: $ Target: $400
 0% 

DM Team Balance


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
Chill it BanG
Junior Member
Join Date: Nov 2013
Location: Latvia
Old 03-18-2014 , 09:52   DM Team Balance
Reply With Quote #1

DM Team Balance
Simple team balance plugin for deathmatch
Current version: 1.44b


What it does?
It balances teams in deathmatch game. Seems legit.

But... why?
Ok, at first, I know that there is plugin called "CSDM Team balance" or somthing like that.
It works by counting deaths. Frankly, I realised that it is not the best way to quickly balance teams, because of time that is needed to start balance.
That is why I made this plugin!

OK, what is the difference?
Firstly - this plugin checks count of players everytime when players disconnect or everytime new round begins (if there ar 1 player versus many players, it happens very often) and if teams are not well balanced it transfers one, randomly chosen, player to weakest team. I belive that detecting disconect is a bit better, but, frankly, I think I will improve this plugin somehow, so teams could be checked more often.
Secondly - there is an admin command to manually start algorythm to switch players to weakst team
Last, but not least - chat command to check if balance is needed (can be dissabled by cvar)

Where it can be used?
I tested this plugin in surf server,that had auto respawn, so I guess it can be used as well as in GunGame, as in CSDM (Have not tested, but it should work...)
But, if you want, you can put in server that doesn`t have respawn, just remember that transfer will happen while player is alive and possible standing next to his ex-teammates OR enable respawn on transfer!

Have something more to say?
Emm, yeah, it also prints colored chat messages with information about player being transfered, e.t.c. No worries, they are not p0k3-colored.
What else, frankly, this is my second plugin, so, go on - tell everything that I could do better!

Can this plugin do tricks?
Well, since it is not old dog it learns new tricks very quickly. Every next verison has bunch of new "tricks"
For instance,
* it can, respawn player when it is transfered, useful if you hate when transfered players steals ex-teams flag (CTF) or even stabs ex-teammates (GG).
* It can also limit team joinment, if you are not sure how to set up mp_limitteams cvar that is included in game and other tricks
* Checks if team balance is needed if someone leaves or goes to spectator

Commands
* say /balance (starts balance... NOTE: if there is enough players (dmb_minplayers) AND can be dissabled by dmb_saybalance)
* dmb_balance (starts balance... NOTE: Admin only (ADMIN_KICK) AND if there is enough players (dmb_minplayers) )

Cvars
dmb_saybalance - (1) enables / (0) disables "say /balance" command (default 1)
dmb_minplayers - Players needed to start balance (default 2)
dmb_roundstarttime - Time (seconds) after round start when team balance can be checked (deafult 10)
dmb_printinchat - (1) enables / (0) disables chat announcments (default 1)
dmb_printincenter - (1) enables / (0) disables screen center messages (default 1)
dmb_printincons - (1) enables / (0) disables console debug informationm shouldn`t be used if plugin since it has bunch of messages (default 0)
dmb_teamlimit - (1) enables / (0) disables team limit. It forces player to join to the weakest team
dmb_respawn - (1) enables / (0) disables respawn after transfer - so players won`t grab ex-team flag (CTF) or stab ex-teammates (GG) (defualt 0)
dmb_infodelay - Time in seconds. How often is "[DMB] Opponents team has more players than yours? Type '/balance' in chat to fix it!" message showed. If less than 20 or "dmb_saybalance 0" - disabled (default 120)
dmb_playsound - (1) enables / (0) disables sound on transfer. Sound is just like "beep" (default 1)
dmb_fadescreen - (1) enables / (0) disables transparent screen fade in color of players new team. Only for transfered player (default 1)
dmb_botimunity - (1) enables / (0) disables Bot immunity, so bots are not included in team checks/ transfers (default 1)
dmb_version - shows version of plugin, you shouldn`t touch this...

Changelog
v1.44b -
* Since I have abondoned CS1.6 and most of game scripting related stuff, not tested and postfixed as beta
* Add dmb_botimunity cvar

v1.43 -
* Fixed "U_R_CT" ML message, why anyone told me about it?
* Little optimization.

v1.41 -
* Added ML support, now you can translate messages into your language and switch them with amx_langmenu! Just edit DM_Balance.txt file.

v1.4 -
* Again, fixed bugs in teamlimit part
* Added sound on tranfer for transfered player (dmb_playsound)
* Added transparent screen fade on transfer for transferd player, in color of his/her new team (dmb_fadescreen)
* Added notification of "say /balance" command:"[DMB] Opponents team has more players than yours? Type '/balance' in chat to fix it!"
(dmb_infodelay). NOTE: if less than 20, it is turned off, and, no, this is not related to "dmb_printinchat"


Older...
Spoiler

To do list
* Add team limit
* Add cvars for game announcments
* Add option to print useful info in console, mostly info for debbuging.
* Add option to respawn player after transfer
* Make better way to search for random player
* "Louder" announcments when player gets transfered, like sound or HUD message
* ML support
* Smart balance, that transfers strongest players to weakest team (some day)


Credits Since I am just begginer (:
* Most of code used in team limit part is taken from ConnorMcLeod, from thread -https://forums.alliedmods.net/showthread.php?t=63818
Thanks to
* DonKisgot (https://forums.alliedmods.net/member.php?u=100584) for great ideas and feedback

More than 250 downloads for previous versions.
DM_Balance.txt goes on data/lang folder. DM_balance.amxx on plugins folder... as always plugins do
Attached Files
File Type: txt DM_balance.txt (358 Bytes, 828 views)
File Type: sma Get Plugin or Get Source (DM_balance.sma - 1861 views - 19.5 KB)
File Type: sma Get Plugin or Get Source (DM_balance._1_44b.sma - 1554 views - 20.0 KB)
__________________
Author of deathrun_ezyKore / fy_NewWorldOrder and some other maps

Last edited by Chill it BanG; 04-03-2016 at 16:52. Reason: Added 1.44b
Chill it BanG 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 08:00.


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