Raised This Month: $140 Target: $400
 35% 

Team Balance Immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-10-2013 , 12:24   Re: Team Balance Immunity
Reply With Quote #231

Quote:
Originally Posted by psychonic View Post
The version that I posted somewhere in the thread should still work fine, even though it's likely over a year or two old now. It only needs a single gamedata offset to be updated, which is much easier to find than a signature.
Thanks mate!

Here's an updated gamedata for your version
Not sure if it's gonna work thought

PHP Code:
"Games"
{
    
"tf"
    
{
        
"Offsets"
        
{
            
"CanBeAutobalanced"
            
{
                
"windows"    "456"
                "linux"        "457"
                "mac"        "458"
            
}
        }
    }

It should work if it was meant for CBaseMultiplayerPlayer::CanBeAutobalanced(voi d)
__________________
...

Last edited by Oshizu; 09-10-2013 at 12:27.
Oshizu is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-10-2013 , 12:29   Re: Team Balance Immunity
Reply With Quote #232

Quote:
Originally Posted by Oshizu View Post
Thanks mate!

Here's an updated gamedata for your version
Not sure if it's gonna work thought

PHP Code:
"Games"
{
    
"tf"
    
{
        
"Offsets"
        
{
            
"CanBeAutobalanced"
            
{
                
"windows"    "456"
                "linux"        "457"
                "mac"        "458"
            
}
        }
    }

It should work if it was meant for CBaseMultiplayerPlayer::CanBeAutobalanced(voi d)
That is the correct function, yes.

Unfortunately, one thing that I forgot about was that I think my include file is different than his, meaning that plugins would need a minor edit to use it instead. (alternatively, the extension could be edited and recompiled to match the other).
psychonic is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 09-13-2013 , 00:35   Re: Team Balance Immunity
Reply With Quote #233

What would we need to change in the plugin?

Is it CanBeAutobalanced instead of OnCanBeAutobalanced?
__________________

DontWannaName is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-13-2013 , 07:32   Re: Team Balance Immunity
Reply With Quote #234

Quote:
Originally Posted by DontWannaName View Post
What would we need to change in the plugin?

Is it CanBeAutobalanced instead of OnCanBeAutobalanced?
Psychonic's version include
PHP Code:
OnCanBeAutobalanced(client, &bool:result); 
Original Version Include:
PHP Code:
OnBalanceCheck(client, &bool:actual); 
They work quite same
Two things need to be done
1. Replace OnBalanceCheck(client, &bool:actual) with OnCanBeAutobalanced(client, &bool:result)
2. Replace in whole code "actual" with "result"

Could be also easily done by python script
__________________
...

Last edited by Oshizu; 09-13-2013 at 15:46.
Oshizu is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 09-14-2013 , 08:52   Re: Team Balance Immunity
Reply With Quote #235

Quote:
Originally Posted by DontWannaName View Post
What would we need to change in the plugin?

Is it CanBeAutobalanced instead of OnCanBeAutobalanced?

Can someone re-compile a working version?
__________________
ph is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-14-2013 , 10:44   Re: Team Balance Immunity
Reply With Quote #236

Quote:
Originally Posted by ph View Post
Can someone re-compile a working version?
Give me link to plugin using older Team Balance immunity and i'il fix it and make compatibile with Psychonic's one.
__________________
...

Last edited by Oshizu; 09-14-2013 at 10:46.
Oshizu is offline
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
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 14:34   Re: Team Balance Immunity
Reply With Quote #238

Done
Attached Files
File Type: sp Get Plugin or Get Source (tb_immune.sp - 48 views - 1.1 KB)
File Type: smx tb_immune.smx (3.3 KB, 45 views)
__________________
...
Oshizu is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-15-2013 , 14:35   Re: Team Balance Immunity
Reply With Quote #239

Quote:
Originally Posted by AeroAcrobat View Post
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".
psychonic is offline
PolyQuad
Member
Join Date: Oct 2011
Old 10-13-2013 , 15:28   Re: Team Balance Immunity
Reply With Quote #240

So is there a working version of this compiled? I tried the versions posted but nothing seems to work anymore.
PolyQuad is offline
Reply


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 20:30.


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