Quote:
Originally Posted by AeroAcrobat
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;
}
|
That is about three times more complicated than it needs to be.
Code:
#include <tf2autobalance>
public Action:OnCanBeAutobalanced(client, &bool:result)
{
if (CheckCommandAccess(client, "balance_immunity", ADMFLAG_CUSTOM1, true))
{
result = false;
return Plugin_Changed;
}
return Plugin_Continue;
}
This is converted to use the other extension and has same default on access (custom1 flag) and can be changed by adding an admin_override for "balance_immunity".