From 7e473490d1022115383df7fbe921ca94c510f736 Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 26 Sep 2024 17:56:37 +0200 Subject: [PATCH] comically retarded solution. but hey if it looks fine its fine --- .../mapchooser_extended_avg_mapend.sp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp index bb601c42..61c570fb 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp @@ -993,6 +993,9 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason) //sometimes it will simply happen that theres a mapvote where nobody votes anything. //have to prevent server from being stuck in those situations with this timer. InitiateVote(MapChange_Instant); //feature so mapvote happens at actual mapend + + CreateTimer(1.0, unfreeze_players, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE); + //extending the map allows players to run around instead of being frozen. should just be careful about it running into edicts limits } delay = float(total_time); return Plugin_Changed; @@ -1001,6 +1004,24 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason) return Plugin_Continue; } +public Action unfreeze_players(Handle hTimer, Handle dp) +{ + char map[64]; + GetCurrentMap(map, PLATFORM_MAX_PATH); + if (StrContains(map, "ze_", false) != -1) + { + ServerCommand("sm_testround"); + CreateTimer(1.0, unfreeze_players2, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE); + } + return Plugin_Handled; +} + +public Action unfreeze_players2(Handle hTimer, Handle dp) +{ + ServerCommand("sm_extend 20"); //this is not actually meant for extending the map. Its meant to unfreeze players during the mapvote. + return Plugin_Handled; +} + public Action Timer_fall_back_map_switch(Handle hTimer, Handle dp) { ForceChangeLevel("ze_random_v9", "nobody voted at mapvote");