Raised This Month: $ Target: $400
 0% 

Get distance from ground


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-09-2013 , 10:01   Re: Get distance from ground
Reply With Quote #7

Yes, my bad, then we can remove useless stuff.
Also, should consider that returning 9999 means there is a problem ;)

PHP Code:
Float:distance_to_groundid )
{
    new 
Float:start[3], Float:end[3];
    
entity_get_vector(idEV_VEC_originstart);
    if( 
entity_get_int(idEV_INT_flags) & FL_DUCKING )
    {
        
start[2] += 18.0;
    }

    
end[0] = start[0];
    
end[1] = start[1];
    
end[2] = start[2] - 9999.0;

    new 
ptr create_tr2();
    
engfunc(EngFunc_TraceHullstartendIGNORE_MONSTERSHULL_HUMANidptr);
    new 
Float:fraction;
    
get_tr2(ptrTR_flFractionfraction);
    
free_tr2(ptr);

    return 
fraction 9999.0;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:55.


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