View Single Post
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 05-30-2012 , 22:33   Re: Tracerays! and detecting water!
Reply With Quote #4

Don't really know much about it, but something like this should do the trick
PHP Code:
new Float:vec[3];
new 
Float:angles[3];

GetClientEyePosition(clientvec);
GetClientEyeAngles(clientangles);


TR_TraceRay(vecanglesMASK_WATERRayType_Infinite);

if(
TR_DidHit())
{
    
// Is looking at water
}
else
{
   
// Is not looking at water

Yours sincerely
Impact
__________________

Last edited by Impact123; 05-30-2012 at 22:35.
Impact123 is offline