Raised This Month: $51 Target: $400
 12% 

Autobalance -Admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Antithasys
Moderator
Join Date: Apr 2008
Plugin ID:
537
Plugin Version:
1.0.1
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Ignores the built-in autobalancer in TF2 for admins with the CUSTOM1 tag.
    Unapprover:
    Reason for Unapproving:
    plugin does not work
    Old 09-05-2008 , 13:56   Autobalance -Admin
    Reply With Quote #1

    Autobalance -Admin (Minus)


    Description:
    Ignores the built-in autobalancer in TF2 for admins with the CUSTOM1 tag.
    Commands:
    None.
    Cvars:
    ab_minusadmin_version
    Copyright:
    GNUv2
    Changelog:
    1.0.1
    Fixed Error: Added error checking for connected clients and non admins

    1.0.0
    Initial Release

    Future Updates:
    None
    Setting your own flag:
    Replace the code in line 51:
    Code:
    if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1) {
    Put any flag you want there and then recomplie and install.
    Installation:
    Place the autobalance-admin.smx in the /sourcemod/plugins dir and you are done.
    I have tested this on my TF2 servers and it appears to be working just fine.

    It's hard to test since you have to get large numbers of players on the server and then see if it switches an admin, but it appears that this will finally allow you to use the built-in team balancer with TF2 again and have it ignore admins.

    NOTE:

    This was determined not to work as the event I hooked does not actually control the switching of players.
    Attached Files
    File Type: sp Get Plugin or Get Source (autobalance-admin.sp - 886 views - 1.5 KB)

    Last edited by Antithasys; 09-06-2008 at 17:13.
    Antithasys is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 09-05-2008 , 14:27   Re: Autobalance -Admin
    Reply With Quote #2

    Wow, that's pretty slick. Didn't know that was possible that way. Good job.
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.
    DJ Tsunami is offline
    Liam
    SourceMod Developer
    Join Date: Jan 2008
    Location: Atlanta, GA
    Old 09-05-2008 , 16:40   Re: Autobalance -Admin
    Reply With Quote #3

    Nice job. Add a public cvar and we'll approve it.
    __________________
    Please don't PM me for support of my plugins. If you have a question, reply in the appropriate thread.

    Weapon Restrictions w/ Warmup
    High Ping Kicker - Lite Edition
    AFK Manager
    Liam is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 09-05-2008 , 18:41   Re: Autobalance -Admin
    Reply With Quote #4

    Maybe add a cvar to change the flag? I can do it manually I bet too.
    __________________

    DontWannaName is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 09-05-2008 , 19:58   Re: Autobalance -Admin
    Reply With Quote #5

    Yeah I'd rather this be for the reserved flag.
    __________________
    msleeper is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 09-05-2008 , 20:20   Re: Autobalance -Admin
    Reply With Quote #6

    Oh, speaking about the flag, I don't think this will work for people with the root flag. You have to manually check for the root flag, something like this:
    Code:
    GetUserFlagBits(client) & (ADMFLAG_CUSTOM1|ADMFLAG_ROOT)
    Can someone else confirm that?
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.
    DJ Tsunami is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-05-2008 , 20:35   Re: Autobalance -Admin
    Reply With Quote #7

    Quote:
    Originally Posted by DJ Tsunami View Post
    Oh, speaking about the flag, I don't think this will work for people with the root flag. You have to manually check for the root flag, something like this:

    Code:
    GetUserFlagBits(client) & (ADMFLAG_CUSTOM1|ADMFLAG_ROOT)


    Can someone else confirm that?
    I use this code for more then 1 plugin and it has always worked in the past. I do not think this is necessary since I don't check for root and it works on them.

    I even confirmed it with a PrintToChat message to make sure the logic worked.
    Antithasys is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-05-2008 , 20:38   Re: Autobalance -Admin
    Reply With Quote #8

    Quote:
    Originally Posted by msleeper View Post
    Yeah I'd rather this be for the reserved flag.
    I use the custom1 flag to set different donation levels on my server, but if you want the reservation, you can change it with the instructions given. Just change ADMFLAG_CUSTOM1 to ADMFLAG_RESERVATION in line 48.
    Antithasys is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 09-06-2008 , 13:46   Re: Autobalance -Admin
    Reply With Quote #9

    L 09/05/2008 - 21:26:10: [SM] Displaying call stack trace for plugin "autobalance-admin.smx":
    L 09/05/2008 - 21:26:10: [SM] [0] Line 48, /home/groups/sourcemod/upload_tmp/phpfT3AQi.sp::HookPlayerBalance()
    L 09/05/2008 - 21:28:50: [SM] Native "GetClientName" reported: Client 2 is not connected
    __________________

    DontWannaName is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-06-2008 , 14:44   Re: Autobalance -Admin
    Reply With Quote #10

    Interesting. I never even run the function GetClientName(). I will add some error checking to make sure the client is connected and the flagbits don't return a 0.
    Antithasys 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 05:45.


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