View Single Post
Author Message
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 02-13-2009 , 21:32   [L4D] VS Auto-spectate on AFK
Reply With Quote #1

This plugin will force players to join the spectators team if they're AFK after certain time. While on spectators team, they will be kicked if they're still AFK after more time (can be disabled). Admins with reserve flag won't be kicked, but will be forced to spectate. Connecting players, while in mid-game, can be forced to spectate.

How to install?
Copy .smx file on your plugins directory. Remember to use the latest 1.2 snapshot.

CVARS:

l4d_specafk_warnspectime: How much time in seconds should a player be AFK to get warned about being forced to spectators. Default is 20.

l4d_specafk_spectime: How many seconds (after warn) will the player be forced to spectate if still on AFK. Default is 15.

l4d_specafk_warnkicktime: Time to warn an AFK player while on spectators team. Default is 30.

l4d_specafk_kicktime: Time to kick an AFK player while on spectators team. Default is 30.

l4d_specafk_checkinteral: How often the plugin warns/checks/actions. Default is 5.

l4d_specafk_kickenabled: If kick is enabled while AFK on spectators. Default is 1 (enabled).

l4d_specafk_speconconnect: If a player connects after the other already leaved the safe room, it will be forced to spectate. He'll get a hit every 10 seconds telling him to press M to join a team. Default is 1 (enabled).

l4d_specafk_showteampanel: Should we show the change team panel to connecting players after team leaved safe room?. Default 0 (hide panel).

Changelog:
1.0
- Initial release.
1.1
- Added new cvars to disabled kick on AFK and to force players to spectate on connect.
- Changed cvar to allow multiple team changes.
- Fixed some general bugs.
1.2.
- Added cvar to show team selection panel.
- Enabled "spectate" command.
- Rollback on method for detecting VS maps.
1.2.1
- Fixed error while reseting AFK timers (Numer Six's post).
- Fixed (finally) method for detecting VS maps. Still using map name, safest way.
- Join team panel is disabled by default.
- Hint to join teams will always show, even if panel is enabled.
1.3
- The AFK manager will start working on round start, but it won't switch ppl to spectators until at least 1 player leaves the safe room. If a player joins and is AFK while inside the safe room, when you leave he will be forced immediately to spectators.
- The HINT message and the choose team panel (if enabled) will show to AFK players too, not just connecting players.
- The AFK manager will be disabled as soon as players reach the rescue vehicule, so you don't get the warnings while the animation is playing.
1.3.1
-
l4d_specafk_speconconnect defaults to 0 (disabled), since valve fixed this. If you want to keep using this, just add this cvar to your server.cfg.
- If "spec on connect" is enabled, and a connecting player joins as a dead survivor, he won't be forced to spectators (not even for being afk).

NOTE: "Get Plugin" will now compile with SM 1.2
Attached Files
File Type: sp Get Plugin or Get Source (L4DVSAutoSpectateOnAFK.sp - 10334 views - 21.7 KB)
__________________
David Romero



Last edited by djromero; 03-14-2009 at 03:54. Reason: Upgraded to version 1.3.1
djromero is offline