Raised This Month: $ Target: $400
 0% 

How to check if a player is in water?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 08-25-2005 , 19:31   How to check if a player is in water?
Reply With Quote #1

Is there anyway to check if a player is in water? Maybe catch the water sound or something?
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-25-2005 , 19:51  
Reply With Quote #2

Code:
if(entity_get_int(id,EV_INT_flags) & FL_INWATER)

Probably, though it may only return if they are fully submerged. This code would see if their is water at their feet (I think):

Code:
new Float:origin[3], Float:mins[3]; entity_get_vector(id,EV_VEC_origin,origin); entity_get_vector(id,EV_VEC_mins,mins); origin[2] += mins[2]; // feet of player theoretically if(PointContents(origin) == CONTENTS_WATER)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 08-25-2005 , 19:55  
Reply With Quote #3

ok, thanks

ill try out the first one first


btw, can you look at my other help thread? about the debug stuff?
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-25-2005 , 20:33  
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?p=54971
Freecode 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 14:31.


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