From 3cd7fb1f248c8f346e3db22fc62e01632d4a3d14 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Mon, 22 Jul 2024 16:41:58 +0300 Subject: [PATCH] fix: use `redm_update_notify` only after read it from `*.json` config (#132) * fix: use `redm_update_notify` only after read it from `*.json` config * Use `redm_update_notify` in `.json` config --- .../addons/amxmodx/configs/redm/gamemode_deathmatch.json | 3 +++ cstrike/addons/amxmodx/scripting/ReDeathmatch.sma | 1 + .../addons/amxmodx/scripting/ReDeathmatch/ReDM_updater.inc | 7 ++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cstrike/addons/amxmodx/configs/redm/gamemode_deathmatch.json b/cstrike/addons/amxmodx/configs/redm/gamemode_deathmatch.json index 78c9c3d..8b2cda3 100644 --- a/cstrike/addons/amxmodx/configs/redm/gamemode_deathmatch.json +++ b/cstrike/addons/amxmodx/configs/redm/gamemode_deathmatch.json @@ -169,6 +169,9 @@ // Mode title HUD Y position. "redm_mode_title_hud_y": "0.85", + // Notify for new ReDM update. + "redm_update_notify": "1", + // ReGameDLL Settings "mp_freeforall": "1", "bot_deathmatch": "1", diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma index 2ee6d82..7172446 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma @@ -90,6 +90,7 @@ public plugin_cfg() { SetActive(redm_active) } CallApi_Initialized() + Updater_Check() } public plugin_end() { diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_updater.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_updater.inc index be41af8..fa943e6 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_updater.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_updater.inc @@ -11,8 +11,7 @@ Updater_Init() { .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, .flags = _FCVAR_BOOLEAN, - .description = "Notify for new ReDM update.^n\ - Don't use into ReDM configs!" + .description = "Notify for new ReDM update." ), redm_update_notify ) @@ -22,8 +21,6 @@ Updater_Init() { ADMIN_MAP, "Checks ReDM update." ) - - CheckUpdate() } public ConCmd_redm_update_check(const player, const level, const commandId) { @@ -56,7 +53,7 @@ Updater_Natives() { return PLUGIN_CONTINUE } -static CheckUpdate() { +Updater_Check() { if (!redm_update_notify) return