Raised This Month: $ Target: $400
 0% 

Check if the player is over the entity and it's touching it


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
!Morte
Veteran Member
Join Date: May 2010
Old 06-22-2014 , 14:54   Check if the player is over the entity and it's touching it
Reply With Quote #1

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 FloatiOrigin]
entity_get_vectoridEV_VEC_originiOrigin )

if( 
iOrigin] >= 140.0 )
{
         
client_printidprint_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_touchMy_Entity"player""function" )

public function( 
entid )
{
           if( !
pev_validid ) )
                   return;

           
g_Touchingid ] = true

And i know that is bad as hell because register_touch it's called a lot of time per second
__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode