Raised This Month: $51 Target: $400
 12% 

Entity is in water


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 06-04-2011 , 12:10   Entity is in water
Reply With Quote #1

I'm trying to check if an entity is in the water, so:

PHP Code:
new Float:vecOrigin[3];
GetEntPropVector(entProp_Send"m_vecOrigin"vecOrigin);

if( 
TR_GetPointContents(vecOrigin) == CONTENTS_WATER ) {
    
// ... Is in water

But actually it doesn't work. Why?
kossolax is offline
SideX
Senior Member
Join Date: Jun 2010
Location: Ukraine, Melitopol.
Old 06-04-2011 , 13:13   Re: Entity is in water
Reply With Quote #2

Use search
http://forums.alliedmods.net/showthr...t=player+water
http://forums.alliedmods.net/showthr...t=player+water
SideX is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 06-04-2011 , 13:19   Re: Entity is in water
Reply With Quote #3

That is for clients, I need this for an entity/point.
kossolax is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 06-04-2011 , 16:56   Re: Entity is in water
Reply With Quote #4

m_nWaterLevel should work with any entity, for checking the point you could try spawning an entity checking its m_nWaterLevel then deleting it.
blodia is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 06-04-2011 , 17:51   Re: Entity is in water
Reply With Quote #5

Quote:
Originally Posted by blodia View Post
m_nWaterLevel should work with any entity, for checking the point you could try spawning an entity checking its m_nWaterLevel then deleting it.
Oh right, using Prop_Data instead of Prop_Send.

Thank's.
kossolax 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 09:09.


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