AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Someone swimming in water? (https://forums.alliedmods.net/showthread.php?t=54017)

[X]-RayCat 04-15-2007 11:19

Someone swimming in water?
 
Is it possible somehow detect if someone is 'swimming' at water?

VEN 04-15-2007 11:41

Re: Someone swimming in water?
 
Yes. You have to check waterlevel pev value.

Quote:

Originally Posted by HLSDK
// waterlevel 0 - not in water
// waterlevel 1 - feet in water
// waterlevel 2 - waist in water
// waterlevel 3 - head in water


[X]-RayCat 04-15-2007 12:09

Re: Someone swimming in water?
 
Quote:

Originally Posted by VEN (Post 465237)
Yes. You have to check waterlevel pev value.

How im going to do that? And i need to check if client even touches water.
(so i should take them all except 0?)

VEN 04-15-2007 12:42

Re: Someone swimming in water?
 
Quote:

i need to check if client even touches water
So not only swimming?

This will detect the cases when a player is also just stay in water (not only swimming).

With engine module: if (entity_get_int(player, EV_INT_waterlevel))
With fakemeta module: if (pev(player, pev_waterlevel))

If you want to know whether he is exactly swimming you have to perform exactly the same check but for flSwimTime pev value.

storm007fire 04-15-2007 13:14

Re: Someone swimming in water?
 
psssp : can i send me the code please for my 24/7 server coming son
[X]-RayCat its superhero

[X]-RayCat 04-15-2007 13:17

Re: Someone swimming in water?
 
Quote:

Originally Posted by storm007fire (Post 465315)
psssp : can i send me the code please for my 24/7 server coming son
[X]-RayCat its superhero

What? Thanx VEN i try something. What would you suggest me to use fm or engine i've been using fakemeta in some plugins.
EDIT: Nvm, i use fakemeta because its already included on my plugin. (didnt remember that)

storm007fire 04-15-2007 17:15

Re: Someone swimming in water?
 
How come u dont share ur plugins :/

Drak 04-15-2007 18:09

Re: Someone swimming in water?
 
How come you can't speak english in you're post above... Which might be obvious why he had no idea what you were talking about.

[X]-RayCat 04-15-2007 18:18

Re: Someone swimming in water?
 
Quote:

Originally Posted by SixTwin (Post 465451)
How come you can't speak english in you're post above... Which might be obvious why he had no idea what you were talking about.

Correct. I have no idea what you're talking about.


All times are GMT -4. The time now is 06:41.

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