AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D] Unscrambler (https://forums.alliedmods.net/showthread.php?t=82270)

Fyren 12-20-2008 07:13

[L4D] Unscrambler
 
4 Attachment(s)
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.

Kigen 12-20-2008 07:51

Re: [L4D] Unscrambler
 
Code:

new MaxClients;
public OnMapStart()
{
    MaxClients = GetMaxClients();
}

Then it'd work with the web compiler?

Fyren 12-20-2008 09:12

Re: [L4D] Unscrambler
 
Quote:

20:47 < predcrab> dont use GetMaxClients()
20:47 < predcrab> use MaxClients
pred commands it.

SAMURAI16 12-20-2008 09:28

Re: [L4D] Unscrambler
 
what if i use sourcemod 1.0.4 ?

Fyren 12-20-2008 09:29

Re: [L4D] Unscrambler
 
If you're using SM 1.0.4 you're not using it with L4D anyway.

SAMURAI16 12-20-2008 10:59

Re: [L4D] Unscrambler
 
yea i just said for making you to use what Kigen said untill sm 1.2 is a official version, not a snapshot

Fexii 12-20-2008 12:36

Re: [L4D] Unscrambler
 
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.

Fyren 12-20-2008 21:39

Re: [L4D] Unscrambler
 
Quote:

Originally Posted by Fexii (Post 730410)
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.

ChillyWI 12-23-2008 12:26

Re: [L4D] Unscrambler
 
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. :)

Fyren 12-23-2008 12:53

Re: [L4D] Unscrambler
 
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.


All times are GMT -4. The time now is 09:54.

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