pXent_settriggerflag (ENTITY* entity, var type, var trigger)
This function uses the volume of a static physics entity as a trigger area that generates an ENABLE_TRIGGER event.
Parameters:
entity Registered PH_STATIC entity.
type NX_TRIGGER_ON_ENTER
NX_TRIGGER_ON_LEAVE
NX_TRIGGER_ON_STAY
NX_TRIGGER_ENABLE (sets all 3 flags together)
trigger 1 = on, 0 = off
Returns:
Trigger area number if successful, 0 otherwise.
Remarks:
This function also sets the entity's ENABLE_TRIGGER flag.
In the event function, the me/my pointer is the trigger area entity, the you pointer is the physics entity that collides with the trigger.
Physics trigger areas work with physics entities only, and are used in special cases when a non-rectangular trigger zone is required. For normal trigger zones that work with all entities, use the region_check command. Do not set trigger areas on dynamic (PH_RIGID) physics objects.
Speed:
Fast
Example:
function EventTrigger()
{
reset(my,TRANSLUCENT); //to visualize the collision
pX_setforcemode(NX_FORCE);
pXent_addexplosion(you,my.x,500,my.max_x/2); // you is the entity that collides with the trigger object
wait(-1);
set(my,TRANSLUCENT);
}
...
ENTITY* trigger_zone = ent_create("earth.mdl",vector(0,0,0),NULL);
pXent_settype(trigger_zone,PH_STATIC,PH_SPHERE);
pXent_settriggerflag(trigger_zone, NX_TRIGGER_ON_ENTER, 1);
trigger_zone.event = EventTrigger;
from a8 manual but i gues you looking for
something diffrent