Raised This Month: $ Target: $400
 0% 

Solved Max Z Stock


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-28-2018 , 06:03   Re: Max Z Stock
Reply With Quote #33

Quote:
Originally Posted by Bugsy View Post
I'm not sure where in the map the origin is getting created, maybe it is in a tight location and then the -75 offset puts it underground? I've never used this map.
I did a minor tweak to your code, also something that affected your code was the maps 'easter egg', which is an underground place.

PHP Code:
public Float:GetMaxHeightid 

    new 
Float:fOrigin] = { 0.00.00.0 }, pcCurrent;
    
    
pevid pev_origin fOrigin ); 
    
    while ( ( 
engfuncEngFunc_PointContents fOrigin ) == CONTENTS_EMPTY ) || (  engfuncEngFunc_PointContents fOrigin ) == CONTENTS_SOLID ) )
    {
        
fOrigin] += 5.0
    }
    
    
pcCurrent engfuncEngFunc_PointContents fOrigin ); 

    if( 
pcCurrent == CONTENTS_SKY )
    {
        return 
fOrigin] -= 105.0;
    }
    return 
0.0

Quote:
Originally Posted by SkumTomteN View Post
HTML Code:
stock Float: get_origin_to_roof(Float:start[3])
{ 
	new Float:dest[3] = {-90.0, 0.0, 0.0}
	engfunc(EngFunc_MakeVectors, dest)
	global_get(glb_v_forward, dest)
	xs_vec_mul_scalar(dest, 9999.0, dest)
	xs_vec_add(start, dest, dest) 

	engfunc(EngFunc_TraceLine, start, dest, 0, 0, 0)
	new Float:origin[3]	
	get_tr2(0, TR_vecEndPos, origin)

	return origin
}
I already fixed the problem but could you explain how that works? I've never worked with trace lines.
__________________

Last edited by edon1337; 07-28-2018 at 06:03.
edon1337 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:27.


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