convert /spawn to 'real' command, must match interact priv
This commit is contained in:
parent
69dc14788f
commit
f82df4fb45
22
commands.lua
22
commands.lua
@ -1,15 +1,16 @@
|
|||||||
minetest.register_on_chat_message(function(name, message, playername, player)
|
command = {}
|
||||||
local cmd ="/spawn"
|
minetest.register_chatcommand("spawn", {
|
||||||
if message:sub(0, #cmd) == cmd then
|
params = "<player>",
|
||||||
if message == '/spawn' then
|
privs = {interact=true},
|
||||||
|
description = "Teleports you to the Spawnpoint",
|
||||||
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
local spawnPoint = minetest.setting_get("static_spawnpoint")
|
local spawnPoint = minetest.setting_get("static_spawnpoint")
|
||||||
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
||||||
minetest.chat_send_player(name, "Teleported to spawn!")
|
minetest.chat_send_player(name, "Teleporting to Spawnpoint...")
|
||||||
return true
|
end,
|
||||||
end
|
})
|
||||||
end
|
--[[ local cmd ="/away"
|
||||||
local cmd ="/away"
|
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/away' then
|
if message == '/away' then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
@ -66,8 +67,9 @@ minetest.register_on_respawnplayer(function(player, pos)
|
|||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
--]]
|
||||||
|
|
||||||
-- Commands, originally by Grailtest @0-afflatus
|
-- Commands, originally by Grailtest @0-afflatus
|
||||||
command = {}
|
|
||||||
|
|
||||||
-- Notices
|
-- Notices
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user