#
# file:: cmd_grant.rb
# This source code copyright (C) 2009 Craig Smith
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#
module Cmd
bindtextdomain("cmd")
# Find and lists objects and their oid
def cmd_grant(args)
case args
when /builder (\w+)/
d = world.all_characters.find {|pid| $1 == get_object(pid).name }
if !d
sendto _("Can't find them.")
else
world.add_builder(d)
sendto _("Permission Granted")
add_event(id,d,:show, _("%{name} has granted you builder permission" % {:name => name}))
d = get_object(d)
log.info("#{name} granted #{d.name} builder permissions")
end
when /admin (\w+)/
d = world.all_characters.find {|pid| $1 == get_object(pid).name }
if !d
sendto _("Can't find them.")
else
world.add_admin(d)
sendto _("Permission Granted")
add_event(id,d,:show, _("%{name} has granted you admin permission" % {:name => name}))
d = get_object(d)
log.info("#{name} granted #{d.name} admin permissions")
end
else
sendto _("@grant builder|admin <playername>")
end
end
end