From f4c8e1f61d9122f8dd6fb44421fdd16e1915f039 Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 29 Jun 2024 23:51:23 +0200 Subject: [PATCH] using cmd to set mapname instead of performing mapswitch --- simulate_ze_server/scripting/simulate_ze_server.sp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/simulate_ze_server/scripting/simulate_ze_server.sp b/simulate_ze_server/scripting/simulate_ze_server.sp index 25f054ee..b78f57a6 100644 --- a/simulate_ze_server/scripting/simulate_ze_server.sp +++ b/simulate_ze_server/scripting/simulate_ze_server.sp @@ -77,13 +77,20 @@ public Action read_info_over_txt(Handle timer, any data) } if (count == 0) //mapname { + //its prefered instead to just fake the mapname since the fakeclients wont have to be kicked on mapchange then. + /* char mapname[256]; GetCurrentMap(mapname, sizeof(mapname)); if (!StrEqual(mapname, lineBuffer)) { - ForceChangeLevel(lineBuffer, ""); + //ForceChangeLevel(lineBuffer, ""); break; } + */ + char cmd[256]; + Format(cmd, sizeof(cmd), "sv_mapname_override %s", lineBuffer); + ServerCommand(cmd); + ServerCommand("mp_timelimit 9000000"); //avoid map switches. also handled server hibernation with https://forums.alliedmods.net/showthread.php?t=331283 } else if (count == 1) //hostname { @@ -162,6 +169,8 @@ public Action read_info_over_txt(Handle timer, any data) CloseHandle(fileHandle); //kicking clients whos UserID is not connected on ze anymore. + + for (int i = 0; i <= MaxClients; i++) { if (IsValidClient(i) && !IsClientSourceTV(i))