From 56b2043232dc525bb89f1ea8a22d8b06e1711539 Mon Sep 17 00:00:00 2001 From: Shorokhov Sergey Date: Sat, 10 Feb 2024 14:17:43 +0300 Subject: [PATCH] Add extended flags to convars --- cstrike/addons/amxmodx/scripting/ReDeathmatch.sma | 1 + .../scripting/ReDeathmatch/Features/AimBarriers.inc | 1 + .../amxmodx/scripting/ReDeathmatch/Modes/Vote.inc | 1 + .../scripting/ReDeathmatch/ReDM_equip_manager.inc | 2 ++ .../scripting/ReDeathmatch/ReDM_features.inc | 13 +++++++++++++ .../scripting/ReDeathmatch/ReDM_round_modes.inc | 1 + .../scripting/ReDeathmatch/ReDM_spawn_manager.inc | 6 +++++- cstrike/addons/amxmodx/scripting/redm_spawns.sma | 2 ++ 8 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma index 933c4c7..d7f02be 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma @@ -49,6 +49,7 @@ public plugin_init() { "redm_active", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Controls the state of Re:DM. \ Don't use into ReDM configs!" ), diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/Features/AimBarriers.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/Features/AimBarriers.inc index c59215b..f7cb35b 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/Features/AimBarriers.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/Features/AimBarriers.inc @@ -24,6 +24,7 @@ AimBarriers_Init() { "redm_aim_barrier", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Enable a barrier in the middle of the map (`anti-rush' system). \ It does not work on `de_`, `cs_` `css_` maps." ), diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/Modes/Vote.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/Modes/Vote.inc index 3f4c68d..745e7a8 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/Modes/Vote.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/Modes/Vote.inc @@ -32,6 +32,7 @@ ModeVote_Init() { "redm_mode_vote_enable", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Enable voting for the next game mode." ), redm_mode_vote_enable diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc index 331442d..a2d6fed 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc @@ -62,6 +62,7 @@ EquipManager_Init() { "redm_keep_weapon_slot", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Restore weapon slot on respawn." ), redm_keep_weapon_slot @@ -71,6 +72,7 @@ EquipManager_Init() { "redm_open_equip_menu", "0", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Open weapon equip menu on spawn." ), redm_open_equip_menu diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_features.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_features.inc index 735c181..065beaf 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_features.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_features.inc @@ -51,6 +51,7 @@ Features_Init() { "redm_open_equip_menu_by_g", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Open equip menu by pressing `G` (drop command)." ), redm_open_equip_menu_by_g @@ -60,6 +61,7 @@ Features_Init() { "redm_block_drop_weapon", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Block the ability to drop the weapon." ), redm_block_drop_weapon @@ -68,6 +70,7 @@ Features_Init() { create_cvar( "redm_healer", "10.0", .has_min = true, .min_val = 0.0, + .flags = _FCVAR_FLOAT, .description = "How much to restore HP when killing an enemy." ), redm_healer @@ -76,6 +79,7 @@ Features_Init() { create_cvar( "redm_healer_hs", "20.0", .has_min = true, .min_val = 0.0, + .flags = _FCVAR_FLOAT, .description = "How much to restore HP when killing with HS an enemy." ), redm_healer_hs @@ -84,6 +88,7 @@ Features_Init() { create_cvar( "redm_sounds_distance", "1500.0", .has_min = true, .min_val = 0.0, + .flags = _FCVAR_FLOAT, .description = "Mute the sounds of other players at a distance." ), redm_sounds_distance @@ -93,6 +98,7 @@ Features_Init() { "redm_fade", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Highlight the display when you kill someone." ), redm_fade @@ -100,6 +106,7 @@ Features_Init() { bind_pcvar_string( create_cvar( "redm_fade_colors", "0 200 0 50", + .flags = _FCVAR_STRING, .description = "Kill highlights color [RGBA]" ), redm_fade_colors, charsmax(redm_fade_colors) @@ -109,6 +116,7 @@ Features_Init() { "redm_refill_ammo", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Refill ammo on kills." ), redm_refill_ammo @@ -118,6 +126,7 @@ Features_Init() { "redm_hitsound", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Play a sound when an enemy is hit." ), redm_hitsound @@ -127,6 +136,7 @@ Features_Init() { "mp_damage_headshot_only", "0", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Enable hits only in HS." ), mp_damage_headshot_only @@ -136,6 +146,7 @@ Features_Init() { "redm_hide_other_deathnotice", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Hide other players' killfeed." ), redm_hide_other_deathnotice @@ -143,6 +154,7 @@ Features_Init() { bind_pcvar_string( create_cvar( "redm_protection_color_t", "200 0 0 15", + .flags = _FCVAR_STRING, .description = "On spawn T protection colors [RGBA]" ), redm_protection_color_t, charsmax(redm_protection_color_t) @@ -150,6 +162,7 @@ Features_Init() { bind_pcvar_string( create_cvar( "redm_protection_color_ct", "0 0 200 15", + .flags = _FCVAR_STRING, .description = "On spawn CT protection colors [RGBA]" ), redm_protection_color_ct, charsmax(redm_protection_color_ct) diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_round_modes.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_round_modes.inc index 47a01f1..a209994 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_round_modes.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_round_modes.inc @@ -18,6 +18,7 @@ RoundModes_Init() { bind_pcvar_string( create_cvar( "redm_modes_switch", "sequentially", + .flags = (_FCVAR_STRING | _FCVAR_BOOLEAN), .description = "Game mode change mode. \ `0`, `disable` - disable modes, \ `random` - random change, \ diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_spawn_manager.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_spawn_manager.inc index 48ffbfe..1592115 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_spawn_manager.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_spawn_manager.inc @@ -11,7 +11,11 @@ static redm_spawn_preset[32] SpawnManager_Init() { bind_pcvar_string( - create_cvar("redm_spawn_preset", "preset"), + create_cvar( + "redm_spawn_preset", + "preset", + .flags = _FCVAR_STRING + ), redm_spawn_preset, charsmax(redm_spawn_preset) ) diff --git a/cstrike/addons/amxmodx/scripting/redm_spawns.sma b/cstrike/addons/amxmodx/scripting/redm_spawns.sma index 76ec577..6ab90d3 100644 --- a/cstrike/addons/amxmodx/scripting/redm_spawns.sma +++ b/cstrike/addons/amxmodx/scripting/redm_spawns.sma @@ -100,6 +100,7 @@ public plugin_cfg() { "redm_randomspawn_los", "1", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0, + .flags = _FCVAR_BOOLEAN, .description = "Check the spawn point for visibility by enemies (line of sight)." ), redm_randomspawn_los @@ -108,6 +109,7 @@ public plugin_cfg() { create_cvar( "redm_randomspawn_dist", "1500.0", .has_min = true, .min_val = 0.0, + .flags = _FCVAR_FLOAT, .description = "Minimum distance to the enemy to enable spawn checks." ), redm_randomspawn_dist