From 24d6d0b9bc4e0d710be5f57ca2dbcbed9dc88b6e Mon Sep 17 00:00:00 2001 From: zaCade Date: Mon, 2 Jan 2023 14:05:49 +0100 Subject: [PATCH] [SaveLevel] Add clear cache command. --- SaveLevel/scripting/SaveLevel.sp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SaveLevel/scripting/SaveLevel.sp b/SaveLevel/scripting/SaveLevel.sp index dccd29e6..68a8a1b2 100644 --- a/SaveLevel/scripting/SaveLevel.sp +++ b/SaveLevel/scripting/SaveLevel.sp @@ -28,6 +28,8 @@ public void OnPluginStart() g_PropAltNames.SetString("m_iName", "targetname"); RegAdminCmd("sm_level", Command_Level, ADMFLAG_GENERIC, "Set a players map level."); + + RegServerCmd("sm_clearlevelcache", Command_ClearCache); } public void OnPluginEnd() @@ -507,6 +509,16 @@ public Action Command_Level(int client, int args) return Plugin_Handled; } +public Action Command_ClearCache(int args) +{ + if(!g_Config || !g_PlayerLevels) + return Plugin_Handled; + + g_PlayerLevels.Clear(); + + return Plugin_Handled; +} + stock int CalcMatches(int Matches, int ExactMatches, int MinMatches, int MaxMatches) { int Value = 0;