Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: redm_randomspawn can't get from config #115

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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