From e0e043d2ad4f5fcb0975482e69921f0166f6becc Mon Sep 17 00:00:00 2001 From: jenz Date: Fri, 31 Jul 2026 23:40:10 +0200 Subject: [PATCH] just a bit better to read --- .../scripting/map_restart_spammer.sp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/map_restart_spammer/scripting/map_restart_spammer.sp b/map_restart_spammer/scripting/map_restart_spammer.sp index a2ba042..44d5fa4 100644 --- a/map_restart_spammer/scripting/map_restart_spammer.sp +++ b/map_restart_spammer/scripting/map_restart_spammer.sp @@ -2,7 +2,8 @@ #include int map_switches_count = -1; -char g_cMaps[500][256]; +char g_cMaps[800][256]; +int g_i_rotate_time = 1; //---------------------------------------------------------------------------------------------------- // Purpose: @@ -16,11 +17,20 @@ public Plugin myinfo = url = "www.unloze.com" }; +public void Cvar_rotate_time(ConVar convar, const char[] oldValue, const char[] newValue) +{ + g_i_rotate_time = convar.IntValue; +} + //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- public void OnPluginStart() { + ConVar cvar; + HookConVarChange((cvar = CreateConVar("sm_map_rotating_time", "5", "time in seconds for map rotation")), Cvar_rotate_time); + g_i_rotate_time = cvar.IntValue; + delete cvar; RegAdminCmd("sm_restartmaps_test", cmd_restart_the_map, ADMFLAG_GENERIC); new Handle:fileHandle = OpenFile("wtf.txt", "r" ); @@ -45,17 +55,17 @@ public Action cmd_restart_the_map(int client, int args) public void OnMapStart() { - if (map_switches_count != -1 && map_switches_count < 400) + if (map_switches_count != -1 && map_switches_count < 500) { - CreateTimer(5.0, time_query_activity); + CreateTimer(float(g_i_rotate_time), time_query_activity); } } public Action time_query_activity(Handle timer, any data) { - LogError("restart count reached: %i", map_switches_count); int local = map_switches_count; map_switches_count++; + LogError("restart count reached: %i. nextmap: %s", map_switches_count, g_cMaps[local]); ForceChangeLevel(g_cMaps[local], ""); return Plugin_Handled; }