I have an entity with a box model, the objetive is everybody have a certain time to get on the entity or they will die.
I have something like this to check if the player is over the entity:
PHP Code:
new Float: iOrigin[ 3 ]
entity_get_vector( id, EV_VEC_origin, iOrigin )
if( iOrigin[ 2 ] >= 140.0 )
{
client_print( id, print_chat, "You're over the entity" )
}
When the player is over the box, his Z origin is > 140.0.
Now the problem is if i just jump away from de box, my Z origin still being > 140.0.
I want to know how i can check if the player is touching the entity without have to use register_touch or any fuction which is called a many often, because i try with this:
PHP Code:
register_touch( My_Entity, "player", "function" )
public function( ent, id )
{
if( !pev_valid( id ) )
return;
g_Touching[ id ] = true
}
And i know that is bad as hell because register_touch it's called a lot of time per second
__________________