puffserver-rocks / puffdev

container for plugin issues and etc
0 stars 0 forks source link

sm_endround (end current round) #8

Closed thehonker closed 2 years ago

thehonker commented 2 years ago

Built-in endround command requires sv_cheats 1 which disables achievements and (for a few milliseconds) opens up the server to attack.

sm_endround should duplicate endround's function without requiring sv_cheats

Example of current usage of endround:

// This file is called by the various configs in custom/custom-modes/

echo "--- start custom/misc/end_round_no_winner.cfg ---"

// temp ignore round win conditions
mp_ignore_round_win_conditions "1"

// Kill everyone to enforce weapon settings
sm_slay @all

// end the round
sv_cheats 1
endround
sv_cheats 0

// re-enable win conditions
mp_ignore_round_win_conditions "0"

echo "--- end custom/misc/end_round_no_winner.cfg ---"
thehonker commented 2 years ago

Working as intended however the callback it blocks is not the round_end event I had hoped it would be so the config layout got a little gross when putting into use ¯\(ツ)