Switch to edit mode.
Name(s): @lock1: set_task_perms(player)
2: if (!valid(dobj = player:my_match_object(dobjstr)))
3: "2016-04-22: DISABLED $vexit stuff, since $WAIF is dead and $vexit is not defined -- Cecil"
4: " dobj = player.location:match_exit(dobjstr)"
5: " if ((typeof(dobj) == $WAIF) && (dobj.class == $vexit))"
6: " \"We can lock those!\""
7: " else"
8: $command_utils:object_match_failed(dobj, dobjstr)
9: return
10: " endif"
11: endif
12: key = $lock_utils:parse_keyexp(iobjstr, player)
13: if (typeof(key) == $STR)
14: player:sub_tell($lock_utils:msg_malformed_key(), key)
15: else
16: try
17: r = dobj:_set_key(key)
18: player:sub_tell($lock_utils:msg_locked(), dobj, $lock_utils:unparse_key(key))
19: except (E_PERM)
20: player:tell("You don't have permission to lock ", dobj:title())
21: except (E_PROPNF)
22: player:tell("Sorry, ", dobj:title(), " is not a @lockable object.")
23: except (ANY)
24: player:tell(`r ! E_VARNF => "unknown error, please report to a wizard."')
25: endtry
26: endif
27: "Last modified by Cecil (#7407) on Fri Apr 22 18:34:55 2016 UTC."