Raised This Month: $ Target: $400
 0% 

Get Ceiling Origin (Trace Ray)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
turtsmcgurts
SourceMod Donor
Join Date: Jul 2011
Old 02-20-2015 , 15:43   Re: Get Ceiling Origin (Trace Ray)
Reply With Quote #4

Code:
decl Float:vecOrigin[3], Float:vecPos[3]; 
GetClientAbsOrigin(client, vecOrigin); 
new Handle:trace = TR_TraceRay(vecOrigin, {-90.0, 0.0, 0.0}, MASK_SHOT_HULL, RayType_Infinite); 
if(TR_DidHit(trace)) { 
    TR_GetEndPosition(vecPos, trace); 
    if(vecOrigin[2]-vecPos[2]> SOME DISTANCE ) { 
        // they're more than SOME DISTANCE units off the ground 
    } 
} 
CloseHandle(trace);
this will return the distance between the player and the ground. reverse the angle and you'll have what you want. Probably want to make a filter to ignore the player. found it from the first result in this google "sourcemod traceray ground"
turtsmcgurts 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 13:12.


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