Raised This Month: $ Target: $400
 0% 

Hook an entity's touch of ground


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 11-03-2014 , 16:30   Re: Hook an entity's touch of ground
Reply With Quote #7

PHP Code:
public pfn_touch(entityid)
{
    if(
pev_valid(entity)
    && !
task_exists(entity+16541))
    {
        if(
pev(entitypev_classname) == g_eClassnameid)
        {
            static 
intOwner
            intOwner 
pev(entitypev(entitypev_euser2) ? pev_euser1 pev_owner)
            
            
client_print(0print_chat"Owner %i: id: %i"intOwnerid)
            
            if(!
pev_valid(id))
            {
                
// Entity System
                
static Float:vecOrigin[3], Float:vecOutput[3]
                
pev(entitypev_originvecOrigin)
                
xs_vec_copy(vecOriginvecOutput)
                
vecOutput[2] -= 30.0
                
                
new iTraceHandle create_tr2()
                
engfunc(EngFunc_TraceLinevecOriginvecOutputIGNORE_MONSTERSidiTraceHandle)
                
get_tr2(iTraceHandleTR_vecEndPosvecOutput)
                
free_tr2(iTraceHandle)
                
                new 
intDiff = (floatround(vecOrigin[2]) - floatround(vecOutput[2]))
                
                
            }
        }
    }
    return 
PLUGIN_CONTINUE

Play with this, it checks walls & ground, so check height or something, to find out
__________________
Retired.

Last edited by Xalus; 11-03-2014 at 16:31.
Xalus is offline
 



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 17:40.


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