simple-shooter-game/mods/game/chatcommands/init.lua
a-bad-dev 2be8eea781 Lots of updates
- Map-specific pre-match times
- Remove /load and change /start syntax to /start <map>
- Scripts for each map that are run at start time, barrier removal time, and end time
- New map forest-3
- A few minor bugfixes
2025-12-23 22:49:31 -04:00

35 lines
918 B
Lua

-- Chatcommands for SSG
core.register_chatcommand("start", {
params = "<map>",
privs = {match_manager = true},
description = "Start a match on <map>",
func = function(_, param)
if not param or param == "" then
return false, "-!- You must specify a map name!"
end
if match_state == "pre_match" or match_state == "post_match" or match_state == "in_progress" then
return false, "-!- Match is already in progress!"
end
start_match(param)
return true, "-!- Match started!"
end
})
core.register_chatcommand("reset", {
params = "",
privs = {match_manager = true},
description = "Terminate the match",
func = function()
if match_state ~= "pre_match" and match_state ~= "post_match" and match_state ~= "not_started" then
core.chat_send_all(core.colorize("red", "Match terminated."))
end_match()
return true
end
return false, "Match cannot be terminated at the moment."
end
})