View Single Post
Author Message
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 06-18-2008 , 16:41   Reserved Spectators/Teams (Inc TF2) V1.5 [21 Jun 08]
Reply With Quote #1

Reserved Spectators/Teams

What does it do?
This plug-in by default restricts players access to the spectator option and only grants access a player to spectator if they are either a root admin or have the reserved flag.

Also this now should work for the following mods:
  • Counter Strike Source
  • Day of Defeat Source
  • Half Life 2 Multiplayer
  • Insurgency Mod
  • Team Fortress 2
If they are not root or do not have the reserved flag there are three things that could happen:

If the player already had a team and try switching
They get moved back to the team they came from

If didn't have a team (just joined), then two there are two options:

With sm_resteams_type set to 1 (default)
The player will be moved to the team with the least amount of players

With sm_resteams_type set to 2
The player will be moved to the team that is losing

In addition to the default method of restricting players, I added another two options which can be set via sm_resteams_team.

By default it restricts the spectators (team 1), however if you were to set this to 2, then it would restrict the access to Terrorists and if set to 3, then it will restrict access to Counter Terrorists (or what ever the team name is in the mod you are using).

Why?
I want spectator access for myself, an army of "core admins" and our sponsors, but to disable it for the battalion of n00blets we have. This plugin will hopefully fulfil my and possibly your requirements, as it will be quite flexible by the time I've finished with it.

I will be adding another mode to this plug-in so that it will let normal admins swap teams (a Team/Clan restriction), this is primarily for us to run "Fight Nights" on our main server, where its the n00b army AKA Team MX take on the regulars in some hardcore "n00b on n00b" action and I don't have to keep moving non members off the team and can concentrate on getting killed in style.

CVars:
sm_resteams_version - Doh!

sm_resteams_enable - Default: 1 (enabled)
Enables the restriction of team joining, spectators by default

sm_resteams_team
- Default: 1 (spectators)
Team to Restrict - Spectators = 1 (default), Terrorists = 2, Counter Terrorist = 3

sm_resteams_type
- Default: 1 (player count)
Spectators swapping by: 1 = Player Count(default), 2 = Team Score

sm_resteams_sound
- Def: buttons/weapon_cant_buy.wav
Sound to play when player is denied access to a team

Installation:
Pop the compiled smx file into your <%MOD DIR%>/addons/sourcemod/plugins folder, change maps and enjoy.

Important Note:
You will need mp_allowspectators set to 1 in your server.cfg file.

Suggestions:
- DONE In V1.5: Will look at TF2 later and see if its possible
- Will be adding a 'clan' mode, so that only clan members can swap teams (coming soon)

Version History:
V1.0 - First Release
V1.5 - Lifted pRED*'s method of dealing with multiple mods and this plugin should now support most mods.

Special Thanks To:
pRED* - For my n00b questions at some silly time of the morning
DJ Tsunami - rount_start eh?
Attached Files
File Type: sp Get Plugin or Get Source (reservedteams.sp - 2269 views - 12.6 KB)
__________________

Last edited by MoggieX; 06-21-2008 at 10:07.
MoggieX is offline
Send a message via Skype™ to MoggieX