Raised This Month: $ Target: $400
 0% 

Get Ceiling Origin (Trace Ray)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ofir753
Senior Member
Join Date: Aug 2012
Old 02-20-2015 , 04:35   Get Ceiling Origin (Trace Ray)
Reply With Quote #1

Im not sure if its possible without Trace ray functions but i want to make a method that returns the origin of the ceiling above a player or at least the Z origin of the ceiling
ofir753 is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-20-2015 , 06:16   Re: Get Ceiling Origin (Trace Ray)
Reply With Quote #2

Fire trace ray and then get dist from trace start pos to celling
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
ofir753
Senior Member
Join Date: Aug 2012
Old 02-20-2015 , 13:07   Re: Get Ceiling Origin (Trace Ray)
Reply With Quote #3

Quote:
Originally Posted by Michalplyoutube View Post
Fire trace ray and then get dist from trace start pos to celling
Im really noob at trace can you send an example code?
ofir753 is offline
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
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 19:50.


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