Add chatcommand to queue restart

This commit is contained in:
rubenwardy 2015-12-30 14:17:06 +00:00
parent dd3d47567e
commit 338bb4e529

View file

@ -35,3 +35,24 @@ minetest.register_chatcommand("ctf_respawn", {
end
end
})
local restart_on_next_match = false
local restart_on_next_match_by = nil
minetest.register_chatcommand("ctf_queue_restart", {
description = "Respawn a player (clean inv, send to base)",
privs = {
server = true
},
func = function(name, param)
restart_on_next_match = true
restart_on_next_match_by = name
return true, "Restart queued."
end
})
ctf_match.register_on_new_match(function()
if restart_on_next_match then
minetest.chat_send_player(restart_on_next_match_by, "Shutting down now!")
minetest.request_shutdown("Restarting server at operator request.", true)
end
end)