Add a better error message when trying to teleport another player without bring privileges

This commit is contained in:
LeMagnesium 2014-10-05 17:35:10 +02:00 committed by ShadowNinja
parent 741df993ff
commit b98e8d6da8

@ -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)'