AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   Team Balance Immunity (https://forums.alliedmods.net/showthread.php?t=129626)

Powerlord 12-29-2015 16:43

Re: Team Balance Immunity
 
Quote:

Originally Posted by psychonic (Post 2377813)
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.

psychonic 12-29-2015 17:03

Re: Team Balance Immunity
 
Quote:

Originally Posted by Powerlord (Post 2377828)
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.

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.

Tranced 12-30-2015 20:25

Re: Team Balance Immunity
 
Quote:

Originally Posted by psychonic (Post 2377813)
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 ;]

psychonic 12-30-2015 20:57

Re: Team Balance Immunity
 
Quote:

Originally Posted by Tranced (Post 2378285)
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.

Tranced 12-30-2015 21:00

Re: Team Balance Immunity
 
Quote:

Originally Posted by psychonic (Post 2378292)
That's correct. It only requires a dev branch build of SM to both compile and run.

Beautiful. Thank you!


All times are GMT -4. The time now is 06:02.

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