Raised This Month: $ Target: $400
 0% 

Get distance from ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-09-2013 , 12:05   Re: Get distance from ground
Reply With Quote #1

Quote:
Originally Posted by ConnorMcLeod View Post
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;

Is there possible to do this without player entity, without entity just a origin?
.Dare Devil. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-09-2013 , 19:31   Re: Get distance from ground
Reply With Quote #2

Quote:
Originally Posted by .Dare Devil. View Post
Is there possible to do this without player entity, without entity just a origin?
You already tried such code with trace_HULL ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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