From bc322ccb50e77c4b97ece4b0a5443e30af3aa158 Mon Sep 17 00:00:00 2001 From: byjumpe Date: Fri, 15 Dec 2023 19:11:00 +0500 Subject: [PATCH] fix regg mapmanager --- .../amxmodx/scripting/regg_mapmanager.sma | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma b/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma index 914d355..f32864d 100644 --- a/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma +++ b/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma @@ -26,11 +26,10 @@ public ReGG_FinishPost(const killer, const victim) { public MapChange() { switch(VoteType){ case 0: { - new mapname[MAX_NAME_LENGTH]; - ArrayGetString(gMapName, random(gMapNums), mapname, charsmax(mapname)); - message_begin(MSG_ALL, SVC_INTERMISSION); - message_end(); - engine_changelevel(mapname); + new next_map[MAX_NAME_LENGTH]; + ArrayGetString(gMapName, random(gMapNums), next_map, charsmax(next_map)); + intermission(); + set_task(3.0, "delay_MapChange", 0, next_map, strlen(next_map) + 1); } case 1: { server_cmd("mapm_start_vote"); @@ -102,3 +101,12 @@ stock bool:isValidMap(mapname[]) { return false; } + +stock intermission() { + message_begin(MSG_ALL, SVC_INTERMISSION); + message_end(); +} + +public delay_MapChange(mapname[]) { + engine_changelevel(mapname); +}