diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/lobby')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut | 3 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut index 0f37251d..33c0b8e9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut @@ -19,7 +19,8 @@ void function Lobby_Init() void function Lobby_OnClientConnectionStarted( entity player ) { - + if ( !( IsPrivateMatch() || GetCurrentPlaylistName() == "private_match" ) || !GetConVarBool( "ns_allow_spectators" ) ) + player.SetPersistentVar( "privateMatchState", 0 ) // disable spectator } void function Lobby_OnClientConnectionCompleted( entity player ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut index c56e537a..c410869e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut @@ -123,7 +123,10 @@ bool function ClientCommandCallback_PrivateMatchSwitchTeams( entity player, arra bool function ClientCommandCallback_PrivateMatchToggleSpectate( entity player, array<string> args ) { - // not currently working, gotta figure it out at some point + if ( file.startState == ePrivateMatchStartState.STARTING || !GetConVarBool( "ns_allow_spectators" ) ) + return true + + player.SetPersistentVar( "privateMatchState", player.GetPersistentVarAsInt( "privateMatchState" ) == 0 ? 1 : 0 ) return true } |