Add /ctf_unqueue_restart

This commit is contained in:
rubenwardy 2016-01-02 14:20:22 +00:00
parent 36e76e7924
commit 2e895b8592

View file

@ -40,7 +40,7 @@ minetest.register_chatcommand("ctf_respawn", {
local restart_on_next_match = false local restart_on_next_match = false
local restart_on_next_match_by = nil local restart_on_next_match_by = nil
minetest.register_chatcommand("ctf_queue_restart", { minetest.register_chatcommand("ctf_queue_restart", {
description = "Respawn a player (clean inv, send to base)", description = "Queue server restart",
privs = { privs = {
server = true server = true
}, },
@ -51,6 +51,17 @@ minetest.register_chatcommand("ctf_queue_restart", {
end end
}) })
minetest.register_chatcommand("ctf_unqueue_restart", {
description = "Unqueue server restart",
privs = {
server = true
},
func = function(name, param)
restart_on_next_match = false
return true, "Restart cancelled."
end
})
ctf_match.register_on_new_match(function() ctf_match.register_on_new_match(function()
if restart_on_next_match then if restart_on_next_match then
minetest.chat_send_player(restart_on_next_match_by, "Shutting down now!") minetest.chat_send_player(restart_on_next_match_by, "Shutting down now!")