Skip to content

Commit

Permalink
redm_spawns: initialize convars on plugin_init()
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Apr 17, 2024
1 parent 5737424 commit dab3f75
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions cstrike/addons/amxmodx/scripting/redm_spawns.sma
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,28 @@ public plugin_init() {
redm_addstyle("preset", "SpawnPreset_DefaultPreset")
redm_addstyle("random", "SpawnPreset_Random")

Create_Convars()

ROGInitialize(.MinDistance = 150.0)
}

public plugin_cfg() {
public plugin_cfg() {
RegisterHookChain(RG_CBasePlayer_UseEmpty, "CBasePlayer_UseEmpty", .post = false)

register_concmd("redm_edit_spawns", "ConCmd_EditSpawns",
MENU_FLAG,
"Edits spawn configuration"
)

register_concmd("redm_convert_spawns", "ConCmd_ConvertOldSpawns",
MENU_FLAG,
"Convert old spawns to new format"
)

Editor_ReloadSpawns()
}

static Create_Convars() {
bind_pcvar_num(get_cvar_pointer("mp_freeforall"), mp_freeforall)
// set_pcvar_bounds(get_cvar_pointer("mp_forcerespawn"), CvarBound_Lower, true, 0.1) // TODO

Expand Down Expand Up @@ -119,20 +137,6 @@ public plugin_cfg() {
),
redm_randomspawn_dist
)

RegisterHookChain(RG_CBasePlayer_UseEmpty, "CBasePlayer_UseEmpty", .post = false)

register_concmd("redm_edit_spawns", "ConCmd_EditSpawns",
MENU_FLAG,
"Edits spawn configuration"
)

register_concmd("redm_convert_spawns", "ConCmd_ConvertOldSpawns",
MENU_FLAG,
"Convert old spawns to new format"
)

Editor_ReloadSpawns()
}

public client_putinserver(player) {
Expand Down

0 comments on commit dab3f75

Please sign in to comment.