get water entity index where player is swimming.
Hello,
If i register touch and player touch water nothing happen, there is no way what i know to get water id where player/entity is in it. How can i do it? Thanks! |
Re: get water entity index where player is swimming.
In PreThink check pev(index, pev_waterlevel).
Or you can check the entities near you with find_ent_in_sphere (searching for "func_water") |
Re: get water entity index where player is swimming.
Quote:
they check all entities and check radius/origin all in same time. when i use this in prethink it will be very horrible. There must be an ohter way |
Re: get water entity index where player is swimming.
What about
Quote:
|
Re: get water entity index where player is swimming.
Quote:
|
Re: get water entity index where player is swimming.
Try with
pev(index, pev_flags) & FL_INWATER |
Re: get water entity index where player is swimming.
Quote:
Not water level, not " is player or entity in water" but water entity id so i can get for example water pev( ent, pev_mins, mins ) or maxs or what ever... |
Re: get water entity index where player is swimming.
search for the nearest water entity using find_ent_in_sphere?
|
Re: get water entity index where player is swimming.
is there any ohter way to do this?
|
Re: get water entity index where player is swimming.
So the problem is that when a player interacts with func_water it is a bit more complex than just your generic entity ::touch.
The engine calls the PM function PM_CheckWater to check whether or not the player is interacting with water and the depth he is at (and what type of water it is). The func_water entity index is never passed in any way when the player is "touching" the water. It is only concerned about waterlevel and watertype.
Spoiler
|
| All times are GMT -4. The time now is 10:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.