function disconnect_event()
{
if (event_type == EVENT_DISCONNECT)
{
ptr_remove(me);
}
}
action actor()
{
...
my.ENABLE_DISCONNECT = ON; // sensible for disconnects
my.emask |= ENABLE_DISCONNECT;
my.event = disconnect_event;
...
}