From c10e77724861c9fefc6d3ea0846751ff4f9dcb98 Mon Sep 17 00:00:00 2001 From: navewindre Date: Mon, 13 Nov 2023 14:39:12 +0100 Subject: reset score on mp_restartgame 1 --- sourcemod/scripting/bot2player_public.smx | Bin 16870 -> 0 bytes sourcemod/scripting/gem_halftime_teamswap.smx | Bin 5863 -> 0 bytes sourcemod/scripting/gem_halftime_teamswap.sp | 12 ++++++++++++ 3 files changed, 12 insertions(+) delete mode 100644 sourcemod/scripting/bot2player_public.smx delete mode 100644 sourcemod/scripting/gem_halftime_teamswap.smx (limited to 'sourcemod/scripting') diff --git a/sourcemod/scripting/bot2player_public.smx b/sourcemod/scripting/bot2player_public.smx deleted file mode 100644 index 7ece816..0000000 Binary files a/sourcemod/scripting/bot2player_public.smx and /dev/null differ diff --git a/sourcemod/scripting/gem_halftime_teamswap.smx b/sourcemod/scripting/gem_halftime_teamswap.smx deleted file mode 100644 index 8db6e80..0000000 Binary files a/sourcemod/scripting/gem_halftime_teamswap.smx and /dev/null differ diff --git a/sourcemod/scripting/gem_halftime_teamswap.sp b/sourcemod/scripting/gem_halftime_teamswap.sp index 5c5a50a..bed6959 100644 --- a/sourcemod/scripting/gem_halftime_teamswap.sp +++ b/sourcemod/scripting/gem_halftime_teamswap.sp @@ -68,6 +68,7 @@ public OnPluginStart(){ CreateConVar("sm_halftime_teamswitch_version", PLUGIN_VERSION, "Halftime teamswitch version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); HookEvent("round_start", Event_RoundStart); HookEvent("round_end", Event_RoundEnd); + HookEvent("restart_round_(1_second)", Event_RestartRound ); g_h_moneyReset = CreateConVar("sm_halftime_money_reset", "1", "If weapons should be removed and money reset to mp_startmoney"); g_h_mp_startmoney = FindConVar("mp_startmoney"); @@ -84,6 +85,17 @@ public OnPluginStart(){ } +public Event_RestartRound( Handle: event, const String:name[], bool dontBroadcast ) { + g_CtScore = 0; + g_TScore = 0; + + g_halftime_do_resetMoney = true; + g_roundCount = 0; + + SetTeamScore(CS_TEAM_CT, g_CtScore); + SetTeamScore(CS_TEAM_T, g_TScore); +} + // RoundStart gets the maptime // Checks to see if halftime has passed, if not then make sure halftime is 0 // Setting halftime false here as well since in some occasions when extending map -- cgit v1.2.3