Raised This Month: $32 Target: $400
 8% 

Team Balance Immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-29-2015 , 16:43   Re: Team Balance Immunity
Reply With Quote #281

Quote:
Originally Posted by psychonic View Post
If using an SM Dev build (1.8.0.5280 or later), immunity can be done for TF2 without a third-party extension.

Here's an example plugin that does it for custom flag 's' (able to be changed in admin_overrides using "autobalance_immunity").

PHP Code:
#include <sourcemod>
#include <sdkhooks>

public Plugin myinfo = {
    
name        "TF2 Autobalance Immunity Example",
    
author      "psychonic",
    
description "",
    
version     "1.0.0",
    
url         "http://www.sourcemod.net"
};

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_CanBeAutobalancedOnCanBeAutobalanced);
}

public 
bool OnCanBeAutobalanced(int clientbool origResult)
{
    if (
CheckCommandAccess(client"autobalance_immunity"ADMFLAG_CUSTOM5true))
    {
        return 
false;
    }
    
    return 
origResult;

Out of curiosity, does this apply to other games as well? I'd heard before that it didn't apply to CS:S/CS:GO or the L4D series, but I wasn't sure if HL2:DM or DoD:S supported it.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-29-2015 , 17:03   Re: Team Balance Immunity
Reply With Quote #282

Quote:
Originally Posted by Powerlord View Post
Out of curiosity, does this apply to other games as well? I'd heard before that it didn't apply to CS:S/CS:GO or the L4D series, but I wasn't sure if HL2M or DoD:S supported it.
I believe that TF2 is the only Valve game that uses this specific function, despite it being in the base/SDK classes. There are some mods and possible third-party Source games that support it. Right now, there is only gamedata for TF2 and Fistful of Frags, but we can add others after confirming support.
psychonic is offline
Tranced
Member
Join Date: Dec 2011
Location: United States
Old 12-30-2015 , 20:25   Re: Team Balance Immunity
Reply With Quote #283

Quote:
Originally Posted by psychonic View Post
If using an SM Dev build (1.8.0.5280 or later), immunity can be done for TF2 without a third-party extension.

Here's an example plugin that does it for custom flag 's' (able to be changed in admin_overrides using "autobalance_immunity").

PHP Code:
#include <sourcemod>
#include <sdkhooks>

public Plugin myinfo = {
    
name        "TF2 Autobalance Immunity Example",
    
author      "psychonic",
    
description "",
    
version     "1.0.0",
    
url         "http://www.sourcemod.net"
};

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_CanBeAutobalancedOnCanBeAutobalanced);
}

public 
bool OnCanBeAutobalanced(int clientbool origResult)
{
    if (
CheckCommandAccess(client"autobalance_immunity"ADMFLAG_CUSTOM5true))
    {
        return 
false;
    }
    
    return 
origResult;

Thank you so much for this! Just to clarify, I just compile this and that's it? Nothing else required from the original zip files? If so, will install this tonight on all of my servers ;]
Tranced is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-30-2015 , 20:57   Re: Team Balance Immunity
Reply With Quote #284

Quote:
Originally Posted by Tranced View Post
Thank you so much for this! Just to clarify, I just compile this and that's it? Nothing else required from the original zip files? If so, will install this tonight on all of my servers ;]
That's correct. It only requires a dev branch build of SM to both compile and run.
psychonic is offline
Tranced
Member
Join Date: Dec 2011
Location: United States
Old 12-30-2015 , 21:00   Re: Team Balance Immunity
Reply With Quote #285

Quote:
Originally Posted by psychonic View Post
That's correct. It only requires a dev branch build of SM to both compile and run.
Beautiful. Thank you!

Last edited by Tranced; 12-30-2015 at 21:01.
Tranced 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 11:26.


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