Raised This Month: $ Target: $400
 0% 

[L4D] Swimming


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zverina
Senior Member
Join Date: Aug 2009
Location: California, USA
Old 08-24-2009 , 00:52   [L4D] Swimming
Reply With Quote #1

Like the title says, I'm pretty sure this is possible but I'm clueless so IDRK but, like in TF2 while you are in water you are able to swim up or down. Maybe someone could add somthing similar to that for L4D? Yeah yeah I know, barely any maps have enough water neck high but, I'm making a map filled with water, and going through it to the saferoom. Allow you to swim up or down would be really useful.
Zverina is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-24-2009 , 03:53   Re: [L4D] Swimming
Reply With Quote #2

Survivors cannot swim? I mean i never tried to swim in l4d there are not any maps with enough water. What usually happens if they go into deep water?
__________________
olj is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-24-2009 , 10:10   Re: [L4D] Swimming
Reply With Quote #3

Here's some example, hope it will help. This will set movetype to fly (not noclip) whenever you press Secondary attack. Press it once more and you will return to default MOVETYPE. Take a note that you may need to fully stop, before you can return to default MOVETYPE.

You can use this as a base. I suggest you check following FLAGS and what they do and if they works.

#define FL_INWATER (1 << 9) // In water
#define FL_FLY (1 << 10) // Changes the SV_Movestep() behavior to not need to be on ground
#define FL_SWIM

EDIT: It seems its just information flags and they not affecting actual game (pretty much like event). When player is in water he have INWATER flag etc. You can check these flags and if he is in vater you can set clients move type (though i dont know if FLY is right movement type for swimming).

EDIT 2: Almost forgot you need SM 1.3 to use OnPlayerRunCmd function.

PHP Code:
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
new bool:InFly[MAXPLAYERS+1];

public 
Plugin:myinfo 

// SetEntDataFloat(
{
    
name "TEST CODE",
    
author "Olj",
    
description "WANNA FLY BABY?",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
}

public 
OnPluginStart()
{
    for (new 
1<=MaxClientsi++)
        {
            
InFly[i] = false;
        }
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
client==0) return Plugin_Continue;
    if (
buttons IN_ATTACK2)
        {
            if (!
InFly[client])
                {    
                    
SetEntityMoveType(clientMOVETYPE_FLY);
                    
InFly[client] = true;
                    return 
Plugin_Continue;
                }
            else if (
InFly[client])
                {
                    
SetEntityMoveType(clientMOVETYPE_CUSTOM);
                    
InFly[client] = false;
                    return 
Plugin_Continue;
                }
        }
    return 
Plugin_Continue;

__________________

Last edited by olj; 08-24-2009 at 10:40.
olj is offline
Zverina
Senior Member
Join Date: Aug 2009
Location: California, USA
Old 08-24-2009 , 15:38   Re: [L4D] Swimming
Reply With Quote #4

alright k ill try it out and no once you go in deep enough water, wen on surface you either hold ur jump button but u move really slowly, staying above survive, or slowly float to the bottom and walk along the dirt...
Zverina is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-25-2009 , 03:18   Re: [L4D] Swimming
Reply With Quote #5

Quote:
Originally Posted by Zverina View Post
alright k ill try it out and no once you go in deep enough water, wen on surface you either hold ur jump button but u move really slowly, staying above survive, or slowly float to the bottom and walk along the dirt...
Well, then setting other movetype while in water may do the trick. Lazy Valve even didnt include swimming in game, lol.
__________________
olj is offline
Kraizen
Member
Join Date: Aug 2009
Old 08-26-2009 , 01:40   Re: [L4D] Swimming
Reply With Quote #6

They stripped that out to put it in l4d2 ;)

Good work btw
Kraizen is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-26-2009 , 02:37   Re: [L4D] Swimming
Reply With Quote #7

Quote:
Originally Posted by Kraizen View Post
They stripped that out to put it in l4d2 ;)
So, thats how they make money ? "L4D2 Will be awesome because we have ALMIGHTY SWIMMING" © Valve
__________________
olj 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 03:52.


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