mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add a better error message when trying to teleport another player without bring privileges
This commit is contained in:
@@ -327,7 +327,10 @@ core.register_chatcommand("teleport", {
|
||||
.. " at "..core.pos_to_string(p)
|
||||
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 p = {}
|
||||
local teleportee_name = nil
|
||||
@@ -364,7 +367,6 @@ core.register_chatcommand("teleport", {
|
||||
.. " to " .. target_name
|
||||
.. " at " .. core.pos_to_string(p)
|
||||
end
|
||||
end
|
||||
|
||||
return false, 'Invalid parameters ("' .. param
|
||||
.. '") or player not found (see /help teleport)'
|
||||
|
Reference in New Issue
Block a user