Skip to content

Commit

Permalink
Add extended flags to convars
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Feb 10, 2024
1 parent 8a10619 commit 56b2043
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions cstrike/addons/amxmodx/scripting/ReDeathmatch.sma
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_features.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -93,13 +98,15 @@ 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
)
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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -136,20 +146,23 @@ 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
)
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)
)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
2 changes: 2 additions & 0 deletions cstrike/addons/amxmodx/scripting/redm_spawns.sma
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 56b2043

Please sign in to comment.