mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Add a better error message when trying to teleport another player without bring privileges
This commit is contained in:
parent
741df993ff
commit
b98e8d6da8
1 changed files with 40 additions and 38 deletions
|
@ -327,7 +327,10 @@ core.register_chatcommand("teleport", {
|
||||||
.. " at "..core.pos_to_string(p)
|
.. " at "..core.pos_to_string(p)
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.check_player_privs(name, {bring=true}) then
|
if not core.check_player_privs(name, {bring=true}) then
|
||||||
|
return false, "You don't have permission to teleport other players (missing bring privilege)"
|
||||||
|
end
|
||||||
|
|
||||||
local teleportee = nil
|
local teleportee = nil
|
||||||
local p = {}
|
local p = {}
|
||||||
local teleportee_name = nil
|
local teleportee_name = nil
|
||||||
|
@ -364,7 +367,6 @@ core.register_chatcommand("teleport", {
|
||||||
.. " to " .. target_name
|
.. " to " .. target_name
|
||||||
.. " at " .. core.pos_to_string(p)
|
.. " at " .. core.pos_to_string(p)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return false, 'Invalid parameters ("' .. param
|
return false, 'Invalid parameters ("' .. param
|
||||||
.. '") or player not found (see /help teleport)'
|
.. '") or player not found (see /help teleport)'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue