View Single Post
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 09-15-2013 , 14:28   Re: Team Balance Immunity
Reply With Quote #237

Quote:
Originally Posted by Oshizu View Post
Give me link to plugin using older Team Balance immunity and i'il fix it and make compatibile with Psychonic's one.
Looking forward for a fix
I think that's the sourcecode:
Code:
#include <sourcemod>
#include <teambalance>

#define PLUGIN_VERSION "1.0"

new Handle:g_hCvarFlags;
new g_Flags = ADMFLAG_RESERVATION;

public Plugin:myinfo = 
{
    name = "Team Balance Immunity",
    author = "Afronanny",
    description = "Protect your admins or donors from the autobalancer!",
    version = PLUGIN_VERSION,
    url = "http://www.afronanny.org/"
}

public OnPluginStart()
{
    HookConVarChange(CreateConVar("teambalance_version", PLUGIN_VERSION, "", FCVAR_NOTIFY), ConVarChanged);
    g_hCvarFlags = CreateConVar("sm_teambalance_flags", "a");
    HookConVarChange(g_hCvarFlags, ConVarChanged);
}

public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if (convar == g_hCvarFlags)
    {
        g_Flags = ReadFlagString(newValue);
        return;
    }
    
    if (!StrEqual(newValue, PLUGIN_VERSION))
    {
        SetConVarString(convar, PLUGIN_VERSION);
    }
    
}

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

Last edited by AeroAcrobat; 09-15-2013 at 14:29.
AeroAcrobat is offline