> I need to figure out how to code in zone type entities into my mod. I
> can get the base entity part, but I need to figure out how to flag a
> player when he's in the entity and then how to reset the flag when he's
> exited the entity's bounds. any ideas how?
If you have an origin of an entity (func_zone or whatever) and you know the
bounding box size of the entity (pev->mins, pev->maxs), it's a fairly simple
task to determine if a player origin is between the entity min and max
coordinates...
if ((player.x >= entity.min.x) && (player.x <= entity.max.x) &&
(player.y >= entity.min.y) && (player.y <= entity.max.y) &&
(player.z >= entity.min.z) && (player.y <= entity.max.z))
{
// think inside the box
}
...of course this assumes that the bounding box of the entity is axially
aligned (aligned with the X, Y, and Z axis).
Jeffrey "botman" Broome
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders