AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Boost Moving Speed in Water(swimming) (https://forums.alliedmods.net/showthread.php?t=83319)

Mlk27 01-07-2009 18:30

Boost Moving Speed in Water(swimming)
 
how do we make player moves or swims faster when he's in water and give him longer breath when he's diving..

Exolent[jNr] 01-07-2009 20:21

Re: Boost Moving Speed in Water(swimming)
 
I got the water speed to work, but I couldn't figure out how to change the delay before the drowning starts.
At the top, you will see my notes.


Code:
// look down

EDIT:

Actually, I did figure everything out.
This code allows you to change just about everything with water damage.
It also allows you to change a player's water speed.
To customize it, just change the #define's at the top to your values.

Code:
// look below

EDIT:

Code is now a full plugin, here: http://forums.alliedmods.net/showthread.php?p=741366

Bad_Bud 01-07-2009 22:28

Re: Boost Moving Speed in Water(swimming)
 
Wow, you kicked this topic's ass. You should post this somewhere for reference.

plasmo 01-07-2009 22:36

Re: Boost Moving Speed in Water(swimming)
 
should be added to the snippets lol

Mlk27 01-07-2009 23:40

Re: Boost Moving Speed in Water(swimming)
 
sweet..thanks alot

and why you're using both to set client's max speed:

Code:

engfunc(EngFunc_SetClientMaxspeed, client, maxspeed);
set_pev(client, pev_maxspeed, maxspeed);

i thought any of them will do the job

and as for longer breath, any different if i use pev_air_finished?

danielkza 01-07-2009 23:49

Re: Boost Moving Speed in Water(swimming)
 
Quote:

Originally Posted by Mlk27 (Post 740215)
sweet..thanks alot

and why you're using both to set client's max speed:

Code:

engfunc(EngFunc_SetClientMaxspeed, client, maxspeed);
set_pev(client, pev_maxspeed, maxspeed);

i thought any of them will do the job

and as for longer breath, any different if i use pev_air_finished?

One of them notifies the engine of the change, and the other stores the value if any other code tries to read it.

Exolent[jNr] 01-08-2009 07:18

Re: Boost Moving Speed in Water(swimming)
 
pev_air_finished is the amount of time in seconds that player has spent not in water.

Bad_Bud 01-08-2009 14:45

Re: Boost Moving Speed in Water(swimming)
 
lol, using ham... you could have someone gib when they drown. That would be hillarious.

Mlk27 01-09-2009 20:55

Re: Boost Moving Speed in Water(swimming)
 
Exolent, why the drown player's health is regenerated when he comes out of water?

Exolent[jNr] 01-09-2009 20:56

Re: Boost Moving Speed in Water(swimming)
 
That is part of the game.


All times are GMT -4. The time now is 09:13.

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