View Single Post
Plugin Info:     Modification:          Category:          Approver:   VEN (29)
Isobold
Veteran Member
Join Date: Mar 2004
Old 01-23-2007 , 06:29   HP Balance 1.5.1
Reply With Quote #1

HP Balance v1.5.1

This plugin tries to balance the game between players by changing players hp in function of their death-kill-ratio on player spawn.

This plugin should work with any mod.

Install:
To install it, just put the hp_balance.sma into the scripting folder, the hp_balance.amxx into the plugins folder and the hp_balance.txt into the data/lang folder. Add hp_balance.amxx to the end of your plugins.ini. Enable the fun-module in your modules.ini.

Features:
HP Balance supports multilanguage, so feel free to translate it and post the translation here.

Configure:
Default is a max. difference of 50% from initial health, and a ratio-multiplier of 10, so that 4 deaths and 3 kills would result in (4-3)*10+100=110% of the initial health. More than 150% and less than 50% would be set to 150% or 50% percent. If you want to change this, open the sma-file in a text-editor of your choice, and change those lines:
Code:
#define SPAWNS_CONSIDERED  10  // Number of respawns considered for calculation of ratio
#define MULTIPLIER         10  // Percentage-multiplier for death-kill-ratio
#define MAX_INC_PERCENTAGE 50  // Max percentage health is increased from base
#define MAX_DEC_PERCENTAGE 50  // if >= 100, min hp is set to 1
#define MAX_PLAYERS        32  // Change this, if your mod and your server are supporting more than 32 players
Compile the plugin using the web compiler or the compiler you downloaded with amxx. Put the new amxx-file into your plugins-folder and change map.
Tip: If you want to award good players instead of balancing the game, just choose a negative multiplier.

Changelog:

Version 1.0:
  • fully working version
Version 1.1:
  • Fixed playerSpawn being launched at demo record and other ResetHUD-events being unequal to spawn
Version 1.2:
  • No more static basic health, but health on spawn as calculation basis, this should take in count those mods with different races with different basis health
Version 1.3:
  • The hp-difference is now fully calculated in %, you may even choose a max. difference of more than 99%, min hp is set to 1 if hp would be 0 or below.
Version 1.4:
  • Plugin now only counts kills-death-ratio within a certain spawn-period. Default is ten respawns. This should prevent players from staying at their level forever on mods as day of defeat.
Version 1.5:
  • Plugin won't make giant steps between each round, but make follow players health only by MULTIPLIER (default 10 %) steps to the real ratio.
  • Min-Health and Max-Health may be adjusted separately.
Version 1.5.1:
  • Little bug at round start, players were starting with only 10 HP ... thx to schlumpf2005 for reporting this

Known Issues:
Due to the rolling kill-death-ratio-deadline, the attributed health points are sometimes not reflecting the actual gaming situation instantly. This is intended, but might confuse players and testers. If you know a better formula than the one used, let me know, and I will look what it's impact is. If you want k-d to be considered without rolling dead line, please use tirvial version.

Languages:
  • Deutsch/German by Isobold
  • Francais/French by Isobold
  • English/English by Isobold
  • Danish translation by Pagh (aKa Phire Nuk3r)

Which version to choose?
If you just want to have hp changed by kill-death-ratio, choose trivial version. If you want the rolling deadline where older kills and deathes are not considered and hp may not change in huge steps, use hp_balance. Both versions need hp_balance.txt .
Attached Files
File Type: sma Get Plugin or Get Source (hp_balance.sma - 1988 views - 7.8 KB)
File Type: txt hp_balance.txt (259 Bytes, 756 views)
File Type: sma Get Plugin or Get Source (hp_balance_trivial.sma - 1637 views - 6.3 KB)

Last edited by Isobold; 03-08-2007 at 14:43. Reason: New version
Isobold is offline