Function: SetPlayerProximityFunction(spawn, distance, in_range_function, leaving_range_function)
Description:
Registers callbacks on a non-Player spawn for Players entering and leaving its range.
Callbacks receive (spawn, player). leaving_range_function may be omitted or empty.
Parameters:
spawn(Spawn) - The non-Player spawn whose script contains the callbacks.distance(number) - Positive range in world units. Enter requires distance strictly less than this value; an active episode leaves only when distance is greater.in_range_function(string) - Required nonempty enter callback name.leaving_range_function(string, optional) - Leave callback name; empty means no leave callback.
Returns: None.
Behavior:
Each continuous visit triggers one enter and one applicable leave callback. Registration
is valid during the spawn's spawn callback, before pending world admission completes.
Registering again replaces that spawn's previous configuration and starts a fresh
episode. State belongs to the original spawn allocation and Client/Player session;
a respawn, reconnect or replacement Player does not inherit the old episode.
Removing or replacing a registration prevents later callbacks from being accepted;
a callback already accepted finishes with its original actors and callback name.
A leave callback may re-enter without the outer call erasing the new episode.