_SIGNAL_TAKE_FROM_INV(L) NAME _signal_take_from_inv - offer monster/container a chance to hold on to an object. SYNOPSIS int _signal_take_from_inv(object given_object); LOCATION Can be placed in any living object or container RETURN VALUE 1 means the monster or container refuses the object to leave it's inventory. 0 means the 'give', 'drop', 'put' or 'get' proceeds normally (the default). DESCRIPTION When a player gets, gives, drops, puts an object from one environment into another this signal will be called in the environment the object currently is located. The environment will be asked if it is willing to let the object be moved from it's inventory. If 1 is returned the object will not be moved. If 0 is returned, the give, drop, etc. will proceed as normal (default). EXAMPLE In a Coca-cola machine that contains coke and the money you put into it. int _signal_take_from_inv(object o) { if (!o->id("coke")) { write("You can only take coke from this machine.\n"); return 1; } return 0; /* Someone is trying to take coke from us, that is okey */ } SEE ALSO _signal_please_take_this(L), can_put_and_get(L)
Help topics available:
_signal | _signal_dropped | _signal_given | _signal_take_from_inv | _signal_gotten |
_signal_environment_died | _signal_lost_connection | _signal_please_take_this |
You are guest number 67 since January 2020.
This file was last modified: June 2000.