Raised This Month: $128 Target: $400
 32% 

[L4D] Unscrambler


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Plugin ID:
687
Plugin Version:
1.0.2.2
Plugin Category:
Server Management
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Unscrambles teams in versus games
    Unapprover:
    Reason for Unapproving:
    Broken.
    Old 12-20-2008 , 08:13   [L4D] Unscrambler
    Reply With Quote #1

    This requires a SM 1.2 snapshot, obviously, since it's for L4D.

    Place the l4dunscrambler.txt file in your sourcemod/gamedata directory.

    The web compiler (which is 1.0.4) can't compile this as I use MaxClients. Feel free to compile on your own (with 1.2+, 1.1+ might work) instead of using the attached smx.

    ----

    Added Windows signatures January 4th.

    Bugfix posted on January 1st.

    Bugfix posted on December 24th.

    Turned off debug again December 28th, accidentally turned it on last update. (#define DEBUG 0 instead of 1, makes pretty big logs when on.)

    In versus, when someone joins mid-game, the server will often scramble teams in later rounds. Until Valve fixes it, trying to play on a team with friends can be frustrating. This plugin stores the team list and at the beginning of a new round, swaps players around if necessary.

    The plugin will create a config file, cfg/sourcemod/l4du.cfg.

    There are two variables that set how long the plugin will try to fix teams on a new map. These are l4du_wait and l4du_holdon. Both are numbers of seconds to wait. It waits l4du_wait seconds before it gives up on trying to fix teams, unless there are still players mid-connect, in which case it waits for l4du_holdon more seconds. So, by default, it waits 30s at most. I do not recommending setting these higher, as people switching teams manually during this time will get forced back if they were playing in the previous map. These times are there to accomodate slow-loading players.

    If you have a problem with the plugin, you should probably change the DEBUG define to 1 and put your log file up somewhere. It will make a log in the sourcemod logs directory. It outputs massive amounts of debug info and echoes to the server console, so you don't want to leave DEBUG 1 all the time, probably.

    Random notes:
    My code sucks but I'm sure Valve will fix the scrambling problem, so I didn't invest much effort into it. It could be much more efficient. It uses the SDKCall()s to properly give a player control of survivor bots as simply using ChangeClientTeam() from SM doesn't do so. I have only tested on my own Linux server as of now, but it works for me with no issues.

    ----

    This requires a SM 1.2 snapshot, obviously, since it's for L4D.

    Place the l4dunscrambler.txt file in your sourcemod/gamedata directory.

    The web compiler (which is 1.0.4) can't compile this as I use MaxClients. Feel free to compile on your own (with 1.2+, 1.1+ might work) instead of using the attached smx.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4dunscrambler.sp - 2493 views - 13.3 KB)
    File Type: smx l4dunscrambler.smx (6.1 KB, 3387 views)
    File Type: smx l4dunscrambler.debug.smx (7.4 KB, 1599 views)
    File Type: txt l4dunscrambler.txt (486 Bytes, 3668 views)

    Last edited by Fyren; 01-04-2009 at 17:48. Reason: updated signatures for Windows
    Fyren is offline
    Kigen
    BANNED
    Join Date: Feb 2008
    Old 12-20-2008 , 08:51   Re: [L4D] Unscrambler
    Reply With Quote #2

    Code:
     new MaxClients;
    public OnMapStart()
    {
         MaxClients = GetMaxClients();
    }
    Then it'd work with the web compiler?
    Kigen is offline
    Fyren
    FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
    Join Date: Feb 2106
    Old 12-20-2008 , 10:12   Re: [L4D] Unscrambler
    Reply With Quote #3

    Quote:
    20:47 < predcrab> dont use GetMaxClients()
    20:47 < predcrab> use MaxClients
    pred commands it.
    Fyren is offline
    SAMURAI16
    BANNED
    Join Date: Sep 2006
    Old 12-20-2008 , 10:28   Re: [L4D] Unscrambler
    Reply With Quote #4

    what if i use sourcemod 1.0.4 ?
    SAMURAI16 is offline
    Send a message via MSN to SAMURAI16
    Fyren
    FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
    Join Date: Feb 2106
    Old 12-20-2008 , 10:29   Re: [L4D] Unscrambler
    Reply With Quote #5

    If you're using SM 1.0.4 you're not using it with L4D anyway.
    Fyren is offline
    SAMURAI16
    BANNED
    Join Date: Sep 2006
    Old 12-20-2008 , 11:59   Re: [L4D] Unscrambler
    Reply With Quote #6

    yea i just said for making you to use what Kigen said untill sm 1.2 is a official version, not a snapshot
    SAMURAI16 is offline
    Send a message via MSN to SAMURAI16
    Fexii
    Junior Member
    Join Date: Dec 2008
    Old 12-20-2008 , 13:36   Re: [L4D] Unscrambler
    Reply With Quote #7

    Nice, I was wondering when somebody would get around to implementing this

    While I was playing around with ChangeClientTeam in Left4Dead, I found that there were many cases of bugs that spawned more than 4 survivors. Also, the screen is messed up if you use the command on somebody who is still spawning as infected.

    I'm not sure if the SDKCall fixes these, but if I were to make this plugin I'd consider using FakeClientCommandEx(client, "jointeam x") and use the spectator team as a temporary player swap location. Especially if you see some of those problems appearing.

    Last edited by Fexii; 12-20-2008 at 13:39.
    Fexii is offline
    Fyren
    FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
    Join Date: Feb 2106
    Old 12-20-2008 , 22:39   Re: [L4D] Unscrambler
    Reply With Quote #8

    Quote:
    Originally Posted by Fexii View Post
    While I was playing around with ChangeClientTeam in Left4Dead, I found that there were many cases of bugs that spawned more than 4 survivors. Also, the screen is messed up if you use the command on somebody who is still spawning as infected.
    The only problem I found with ChangeClientTeam() is what I mentioned in the first post. Well, I found that if you switched someone from survivor to survivor (not that you'd do that on purpose anyway) it'd make bots that sat in spec, clogging the slots, and eventually crashing if you filled them all and did it again.
    Fyren is offline
    ChillyWI
    Senior Member
    Join Date: Aug 2008
    Old 12-23-2008 , 13:26   Re: [L4D] Unscrambler
    Reply With Quote #9

    As I posted elsewhere, this has worked flawlessly for us so far. The only thing that could make it better would be locking the active spawn door until the grace period has changed. On public servers friendly fire might be an issue there too. You could always completely disable movement for players until they're on the correct team or until someone opens the spawn door. Of course, that's assuming Valve doesn't fix it themselves.
    ChillyWI is offline
    Fyren
    FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
    Join Date: Feb 2106
    Old 12-23-2008 , 13:53   Re: [L4D] Unscrambler
    Reply With Quote #10

    I could make a separate plugin that freezes everyone on round start until either a certain period elapses or there are eight humans. (Though I can lock the saferoom door, that doesn't help on the first levels.) I guess the problem is more people being dumb and impatient so it's separate issue from the scrambling anyway. Could help in co-op, too.
    Fyren 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 23:59.


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