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

Team Balance Immunity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Afronanny
Veteran Member
Join Date: Aug 2009
Old 06-14-2010 , 23:33   Team Balance Immunity
Reply With Quote #1

Team Balance Immunity

This extension allows you to use Valve's autobalance system, which is, in my opinion the best one, and give certain people immunity to it. A basic sample immunity plugin is included that gives people with the 'a' flag immunity to autobalance.

The regular version will download an updated version of the gamedata if it changes. I have added versions of the extension so that you can opt-out of automatic gamedata updates if you wish.


Instructions
  1. Extract the contents of the archive to your game folder (tf or cstrike)
  2. Give yourself (and any others) admin flag 'a', or whatever you change it to in the example plugin using the 'sm_teambalance_flags' cvar
  3. Load the example plugin
Download:

TF2:
Regular: 1.0
No Automatic Gamedata Updater (Not recommended): 1.0

CSS (Linux version does not work at the moment):
Regular: 1.0
No Automatic Gamedata Updater (Not recommended): 1.0
The Linux CS:S version has a very nasty crash that I have been unable to track down. All debug and crash data I have collected has been utterly useless. I don't forsee a fix in the near future.

Source code available
Here
The source code is the same for all versions, TF2 and CS:S. They are compiled using defines, so you need only un-comment or comment out whichever options you want in extension.cpp if you are compiling this yourself.

SourcePawn Forwards:
PHP Code:
/**  
 * @brief Called when the balancer wants to know if a player can be autobalanced  *  
 * @param client    Index of the client
 * @param actual    Result as determined by the server. Overwrite and return Plugin_Handled to force a value.  
 * @return         True to allow player to be seen, false to disallow player being seen  
 */ 

forward Action:OnBalanceCheck(client, &bool:actual); 
How to use in a plugin:
PHP Code:
#include <teambalance>
#include <sourcemod>

public Action:OnBalanceCheck(client, &bool:actual)
{
    if (
GetUserFlagBits(client) & ADMFLAG_GENERIC)
    {
        
actual false;
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;


Last edited by Afronanny; 09-07-2012 at 09:13.
Afronanny is offline
 


Thread Tools
Display Modes

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 22:22.


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