From 9bdaa4f38381b610e22579dd5a7a72619d7545b0 Mon Sep 17 00:00:00 2001 From: jenz Date: Sun, 27 Jul 2025 02:38:30 +0200 Subject: [PATCH] just pushed --- .../scripting/maps_66_tick.txt | 18 ++++++++ .../scripting/set_tickrate_for_nextmap.sp | 46 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 set_tickrate_nextmap/scripting/maps_66_tick.txt create mode 100644 set_tickrate_nextmap/scripting/set_tickrate_for_nextmap.sp diff --git a/set_tickrate_nextmap/scripting/maps_66_tick.txt b/set_tickrate_nextmap/scripting/maps_66_tick.txt new file mode 100644 index 0000000..e8ef6a9 --- /dev/null +++ b/set_tickrate_nextmap/scripting/maps_66_tick.txt @@ -0,0 +1,18 @@ +ze_collective_css5 +ze_diddle_v3_css2 +ze_tloz_celestia_a4 +ze_scp_v4 +ze_ocarina_of_time_v1_0 +ze_scp_v3 +ze_discount_v1_2 +ze_castlevania_v1_3 +ze_doom3_v1 +ze_harry_potter_v2_1 +ze_last_man_standing_v6_1 +ze_lotr_minas_tirith_v3_3 +ze_mkzk_scarab_v4 +ze_ouroboros_v2 +ze_ouroboros_v3 +ze_randomizer_c1s4 +ze_rev_s2 +ze_best_korea_css3 diff --git a/set_tickrate_nextmap/scripting/set_tickrate_for_nextmap.sp b/set_tickrate_nextmap/scripting/set_tickrate_for_nextmap.sp new file mode 100644 index 0000000..3d62b42 --- /dev/null +++ b/set_tickrate_nextmap/scripting/set_tickrate_for_nextmap.sp @@ -0,0 +1,46 @@ +#pragma semicolon 1 +#define PLUGIN_AUTHOR "jenz" +#define PLUGIN_VERSION "1.0" + +#include +#include + +//https://github.com/Mikusch/SM-TickrateChanger/tree/main + +public Plugin myinfo = +{ + name = "tickrate_command_caller", + author = PLUGIN_AUTHOR, + description = "set tickrate based on what nextmap is", + version = PLUGIN_VERSION, + url = "www.unloze.com" +}; + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- + +public void OnMapVoteEnd(const char[] map) +{ + new Handle:fileHandle = OpenFile("maps_66_tick.txt", "r" ); + char lineBuffer[256]; + bool changeTick = false; + while(!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, lineBuffer, sizeof(lineBuffer))) + { + TrimString(lineBuffer); + if (StrEqual(map, lineBuffer, false)) + { + changeTick = true; + break; + } + } + CloseHandle(fileHandle); + if (changeTick) + { + ServerCommand("sm_tickrate 66"); + } + else + { + ServerCommand("sm_tickrate 100"); + } +}