This commit is contained in:
zaoqi 2017-06-17 15:10:47 +08:00
parent 304951e257
commit 5bdefc1a72
2 changed files with 8 additions and 10 deletions

View File

@ -60,6 +60,13 @@ core.register_chatcommand("clear_chat_queue", {
end,
})
core.register_chatcommand("respawn", {
description = core.gettext("Respawn"),
func = function(param)
core.send_respawn()
end,
})
function core.run_server_chatcommand(cmd, param)
core.send_chat_message("/" .. cmd .. " " .. param)
end

View File

@ -10,14 +10,5 @@ dofile(clientpath .. "chatcommands.lua")
dofile(commonpath .. "vector.lua")
core.register_on_death(function()
core.display_chat_message("You died.")
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
"label[4.85,1.35;" .. fgettext("You died.") .. "]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
core.show_formspec("bultin:death", formspec)
end)
core.register_on_formspec_input(function(formname, fields)
if formname == "bultin:death" then
core.send_respawn()
end
core.display_chat_message("You died.Respawn: .respawn")
end)