No. But you can edit or mod \ns2\lua\NS2ConsoleCommands_Server.lua:47 to fail when the player attempts to join the Spectator team, and register an admin config setting to control this behavior, which updates on map change.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->local function Spectate(player) local specEnabled = Server.GetConfigSetting("spectate_enabled") if specEnabled and specEnabled == false then return false, player else return GetGamerules():JoinTeam(player, kSpectatorIndex) end end<!--c2--></div><!--ec2-->
I can put this up on the workshop as a mod if you want + a server admin command for toggling the setting on/off live. Or else you'd have to exclude the file from consistency checks.
If you want to give admins the ability to join spec I can look if it is possible to add that.
Wow, I'd love to have the mod version you describe. If it's too much of a hassle for the admin to be able to spectate then don't kill yourself coding that in. I'd be grateful with just the latter.
My reason for asking about turning off spectator in the first place is that I have seen multiple people playing from the same ip's so they obviously know each other and one will spectate the op team and are telling revealing information to the others. To me this is bad sportsmanship.
I'd be more than happy to test out your mod on my server if you like :)
Comments
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->local function Spectate(player)
local specEnabled = Server.GetConfigSetting("spectate_enabled")
if specEnabled and specEnabled == false then
return false, player
else
return GetGamerules():JoinTeam(player, kSpectatorIndex)
end
end<!--c2--></div><!--ec2-->
I can put this up on the workshop as a mod if you want + a server admin command for toggling the setting on/off live. Or else you'd have to exclude the file from consistency checks.
If you want to give admins the ability to join spec I can look if it is possible to add that.
My reason for asking about turning off spectator in the first place is that I have seen multiple people playing from the same ip's so they obviously know each other and one will spectate the op team and are telling revealing information to the others. To me this is bad sportsmanship.
I'd be more than happy to test out your mod on my server if you like :)
If I edit the file NS2ConsoleCommands_Server.lua will my server appear as modded or is this truly server-side only?