From 60dc215503c21f5a788a0b5cc6304480445de4ab Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 24 Jul 2009 00:41:39 +0200 Subject: [PATCH 1/3] Added zr_zspawn_block_rejoin CVAR. Defaulted to 1 (block). --- cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg | 4 ++++ src/zr/cvars.inc | 4 +++- src/zr/zspawn.inc | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg index eb9bbe9..19130a4 100644 --- a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg +++ b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg @@ -617,6 +617,10 @@ zr_zspawn_team_override "1" // Default: "0" zr_zspawn_team_zombie "0" +// Block players disconnecting and rejoing the game using zspawn. +// Default: "1" +zr_zspawn_block_rejoin "1" + // Put a time limit on the use of ZSpawn. // Default: "1" zr_zspawn_timelimit "1" diff --git a/src/zr/cvars.inc b/src/zr/cvars.inc index 0b213ab..dc1b6b1 100644 --- a/src/zr/cvars.inc +++ b/src/zr/cvars.inc @@ -146,6 +146,7 @@ enum CvarsList Handle:CVAR_ZSPAWN, Handle:CVAR_ZSPAWN_TEAM_OVERRIDE, Handle:CVAR_ZSPAWN_TEAM_ZOMBIE, + Handle:CVAR_ZSPAWN_BLOCK_REJOIN, Handle:CVAR_ZSPAWN_TIMELIMIT, Handle:CVAR_ZSPAWN_TIMELIMIT_TIME, Handle:CVAR_ZSPAWN_TIMELIMIT_ZOMBIE, @@ -440,10 +441,11 @@ CvarsCreate() g_hCvarsList[CVAR_ZSPAWN_TEAM_OVERRIDE] = CreateConVar("zr_zspawn_team_override", "1", "Override spawn team when spawning by means of ZSpawn."); g_hCvarsList[CVAR_ZSPAWN_TEAM_ZOMBIE] = CreateConVar("zr_zspawn_team_zombie", "0", "Spawn player on zombie team when spawning by means of ZSpawn. [Dependency: zr_zspawn_team_override | Override: zr_respawn_zombie]"); + g_hCvarsList[CVAR_ZSPAWN_BLOCK_REJOIN] = CreateConVar("zr_zspawn_block_rejoin", "1", "Block players disconnecting and rejoing the game using zspawn."); g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT] = CreateConVar("zr_zspawn_timelimit", "1", "Put a time limit on the use of ZSpawn."); g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_TIME] = CreateConVar("zr_zspawn_timelimit_time", "120.0", "Time from the start of the round to allow ZSpawn. [Dependency: zr_zspawn_timelimit]"); - g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE] = CreateConVar("zr_zspawn_timelimit_zombie", "1", "Spawn player on the zombie team AFTER the timelimit is up. ['-1' = Block ZSpawn | '0' = Spawn as human | '1' = Spawn as zombie | Dependency: zr_zspawn_timelimit]"); + g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE] = CreateConVar("zr_zspawn_timelimit_zombie", "1", "Spawn player on the zombie team AFTER the timelimit is up. ['-1' = Block ZSpawn | '0' = Spawn as human | '1' = Spawn as zombie | Dependency: zr_zspawn_timelimit]"); // =========================== diff --git a/src/zr/zspawn.inc b/src/zr/zspawn.inc index ecee380..eaf2baf 100644 --- a/src/zr/zspawn.inc +++ b/src/zr/zspawn.inc @@ -210,7 +210,8 @@ bool:ZSpawnClient(client, bool:force = false, bool:zombie = false) } // Block if client has already played during this round. - if (!force && SteamidCacheClientExists(g_hZSpawnSteamIDCache, client)) + new blockrejoin = GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_BLOCK_REJOIN]); + if (!force && SteamidCacheClientExists(g_hZSpawnSteamIDCache, client) && blockrejoin) { // Tell client the command may only be used when joining late. TranslationPrintToChat(client, "ZSpawn double spawn"); From 98a0fa29d74c3e8b3686523865ae95cc8bfd2385 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 24 Jul 2009 00:57:10 +0200 Subject: [PATCH 2/3] Bumped version. This is just a test and not the actual release unless this revision gets tagged. --- src/zombiereloaded.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 87c55fd..1474976 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -32,7 +32,7 @@ #include #include -#define VERSION "3.0-dev" +#define VERSION "3.0.0-b1" // Header includes. #include "zr/log.h" From d6966910a0129b309e5ec258c5d96c7dd9bda6a2 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 24 Jul 2009 00:58:03 +0200 Subject: [PATCH 3/3] Restored version number. --- src/zombiereloaded.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 1474976..5e95008 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -32,7 +32,7 @@ #include #include -#define VERSION "3.0.0-b1" +#define VERSION "3.0.0-dev" // Header includes. #include "zr/log.h"