Raised This Month: $ Target: $400
 0% 

Solved Max Z Stock


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-13-2018 , 10:38   Max Z Stock
Reply With Quote #1

Hi,

I have this stock that finds the highest point on the map by adding velocity until we reach CONTENTS_SKY, but sometimes it randomly spawns me on the ground. Are there any better stocks or any improvements to be done to this stock? I believe it spawns me to the ground because neither of the loops happen and return 0.0 is the return value, but why?

PHP Code:
Float:GetMaxHeightid 

    new 
Float:fOrigin], Float:fDist
    
pevidpev_originfOrigin ); 
    
    
fDist fOrigin]; 
    
    while( 
engfuncEngFunc_PointContentsfOrigin ) == CONTENTS_EMPTY 
    
fOrigin] += 5.0
    
    if( 
engfuncEngFunc_PointContentsfOrigin ) == CONTENTS_SKY 
    return ( 
fOrigin] - fDist ); 
    
    return 
0.0;

__________________

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