end,
})
-core.register_chatcommand("hasprivs", {
+core.register_chatcommand("haspriv", {
params = "<privilege>",
description = "Return list of all online players with privilege.",
privs = {basic_privs = true},
func = function(caller, param)
param = param:trim()
if param == "" then
- return false, "Invalid parameters (see /help hasprivs)"
+ return false, "Invalid parameters (see /help haspriv)"
end
if not core.registered_privileges[param] then
return false, "Unknown privilege!"
end
local privs = core.string_to_privs(param)
- local players_with_privs = {}
+ local players_with_priv = {}
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
if core.check_player_privs(player_name, privs) then
- table.insert(players_with_privs, player_name)
+ table.insert(players_with_priv, player_name)
end
end
- return true, "Players online with the \"" .. param .. "\" priv: " ..
- table.concat(players_with_privs, ", ")
+ return true, "Players online with the \"" .. param .. "\" privilege: " ..
+ table.concat(players_with_priv, ", ")
end
})
end
teleportee = core.get_player_by_name(name)
if teleportee then
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting to "..core.pos_to_string(p)
end
end
if target_name then
local target = core.get_player_by_name(target_name)
if target then
- p = target:getpos()
+ p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting to " .. target_name
.. " at "..core.pos_to_string(p)
end
teleportee = core.get_player_by_name(teleportee_name)
end
if teleportee and p.x and p.y and p.z then
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. core.pos_to_string(p)
end
if target_name then
local target = core.get_player_by_name(target_name)
if target then
- p = target:getpos()
+ p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. target_name
.. " at " .. core.pos_to_string(p)
return false, "Cannot spawn an unknown entity"
end
if p == "" then
- p = player:getpos()
+ p = player:get_pos()
else
p = core.string_to_pos(p)
if p == nil then