Add chatcommand to queue restart
This commit is contained in:
parent
dd3d47567e
commit
338bb4e529
1 changed files with 21 additions and 0 deletions
|
@ -35,3 +35,24 @@ minetest.register_chatcommand("ctf_respawn", {
|
||||||
end
|
end
|
||||||
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)
|
||||||
|
|
Loading…
Reference in a new issue