Sergei Mozhaisky 2ac5a5fc35
Update default game (#31)
* update: xpanes

* update wool

* update walls

* update vessels

* update tnt

* update stairs

* update spawn

* update sfinv

* update sethome

* update screwdriver

* update player_api

* update map

* update give_initial_stuff

* update game_commands

* update flowers

* update fireflies

* update fire

* update dye

* update dungeon_loot

* update doors

* update creative

* update butterflies

* update bucket

* update bones

* update boats

* update binoculars

* update beds

* update default

* revert to stairs_redo

* mc brick texture

* add xpanes_space.png as dependency
2020-05-25 12:35:59 +03:00

32 lines
834 B
Lua

-- game_commands/init.lua
-- Load support for MT game translation.
local S = minetest.get_translator("game_commands")
minetest.register_chatcommand("killme", {
description = S("Kill yourself to respawn"),
func = function(name)
local player = minetest.get_player_by_name(name)
if player then
if minetest.settings:get_bool("enable_damage") then
player:set_hp(0)
return true
else
for _, callback in pairs(minetest.registered_on_respawnplayers) do
if callback(player) then
return true
end
end
-- There doesn't seem to be a way to get a default spawn pos
-- from the lua API
return false, S("No static_spawnpoint defined")
end
else
-- Show error message if used when not logged in, eg: from IRC mod
return false, S("You need to be online to be killed!")
end
end
})