AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to check if a player is in water? (https://forums.alliedmods.net/showthread.php?t=17103)

Sp4rt4n 08-25-2005 19:31

How to check if a player is in water?
 
Is there anyway to check if a player is in water? Maybe catch the water sound or something?

XxAvalanchexX 08-25-2005 19:51

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)

Sp4rt4n 08-25-2005 19:55

ok, thanks :)

ill try out the first one first


btw, can you look at my other help thread? about the debug stuff?

Freecode 08-25-2005 20:33

http://forums.alliedmods.net/showthread.php?p=54971


All times are GMT -4. The time now is 14:31.

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