Raised This Month: $ Target: $400
 0% 

Increase player speed when ducking


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 01-03-2009 , 05:04   Increase player speed when ducking
#1

Hi, I want to get same player speed when walking / ducking. How ?
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-03-2009 , 06:32   Re: Increase player speed when ducking
#2

Can I ask what is this? I wrote nice plugin here, AM tiled and my script is gone!
Didn't understand do you want walk speed when ducking, or run speed when ducking and walking, still...
You would check it in prethink, and just set the speed, also...
I think IN_WALK = !IN_RUN, !IN_DUCK, like this:
Code:
if((~pev(id, pev_button) & IN_DUCK) || (~pev(id, pev_oldbuttons) & IN_DUCK))
//And same with IN_RUN also...

Last edited by SnoW; 01-03-2009 at 07:50.
SnoW is offline
Send a message via MSN to SnoW
Old 01-03-2009, 06:32
SnoW
This message has been deleted by SnoW. Reason: How I double posted, eh?
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-03-2009 , 08:24   Re: Increase player speed when ducking
#3

workaround :

Ask player if they allow your plugin to change their vars :

cl_forwardspeed, cl_backspeed, cl_sidespeed

If player say yes, change vars to sv_maxspeed value
Else, do what you want, kick of let them play.

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Duck Speed"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define FACTOR    2.35

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_PlayerPreThink"PlayerPreThink")

    
set_cvar_float("sv_maxspeed"610.0)
}

public 
PlayerPreThink(id)
{
    if( 
pev(idpev_button) & IN_DUCK )
    {
        if( !(
pev(idpev_oldbuttons) & IN_DUCK) )
        {
            
cs_set_user_duckspeed(id)
        }
    }
    else
    {
        if( 
pev(idpev_oldbuttons) & IN_DUCK )
        {
            
cs_reset_user_maxspeed(id)
        }
    }
}

stock cs_reset_user_maxspeed(id)
{
    new 
Float:flMaxSpeed;
    switch ( 
get_user_weapon(id) )
    {
        case 
CSW_SG550CSW_AWPCSW_G3SG1 flMaxSpeed 210.0;
        case 
CSW_M249 flMaxSpeed 220.0;
        case 
CSW_AK47 flMaxSpeed 221.0;
        case 
CSW_M3CSW_M4A1 flMaxSpeed 230.0;
        case 
CSW_SG552 flMaxSpeed 235.0;
        case 
CSW_XM1014CSW_AUGCSW_GALILCSW_FAMAS flMaxSpeed 240.0;
        case 
CSW_P90 flMaxSpeed 245.0;
        case 
CSW_SCOUT flMaxSpeed 260.0;
        default : 
flMaxSpeed 250.0;
    }
    
engfunc(EngFunc_SetClientMaxspeedidflMaxSpeed);
    
set_pev(idpev_maxspeedflMaxSpeed);
}

stock cs_set_user_duckspeed(id)
{
    new 
Float:flMaxSpeed;
    switch ( 
get_user_weapon(id) )
    {
        case 
CSW_SG550CSW_AWPCSW_G3SG1 flMaxSpeed 210.0*FACTOR;
        case 
CSW_M249 flMaxSpeed 220.0*FACTOR;
        case 
CSW_AK47 flMaxSpeed 221.0*FACTOR;
        case 
CSW_M3CSW_M4A1 flMaxSpeed 230.0*FACTOR;
        case 
CSW_SG552 flMaxSpeed 235.0*FACTOR;
        case 
CSW_XM1014CSW_AUGCSW_GALILCSW_FAMAS flMaxSpeed 240.0*FACTOR;
        case 
CSW_P90 flMaxSpeed 245.0*FACTOR;
        case 
CSW_SCOUT flMaxSpeed 260.0*FACTOR;
        default : 
flMaxSpeed 250.0*FACTOR;
    }
    
engfunc(EngFunc_SetClientMaxspeedidflMaxSpeed);
    
set_pev(idpev_maxspeedflMaxSpeed);

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-02-2012 at 15:47. Reason: Removed slowhack
ConnorMcLeod is offline
leonard19941
Veteran Member
Join Date: Jun 2011
Old 07-01-2012 , 08:47   Re: Increase player speed when ducking
#4

Connor, this would not SlowHack?
__________________

Last edited by ConnorMcLeod; 07-02-2012 at 15:47. Reason: removed slowhack
leonard19941 is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-01-2012 , 08:57   Re: Increase player speed when ducking
#5

01-03-09 07:24 AM


Last edited by dFF; 07-01-2012 at 08:57.
dFF is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-01-2012 , 11:34   Re: Increase player speed when ducking
#6

Who cares about cl_speed slowhack? -.-
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-01-2012 , 12:43   Re: Increase player speed when ducking
#7

Any setting change without client's permission is slowhack.
Can even consider HLGuard as slowhacking.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-01-2012 , 13:43   Re: Increase player speed when ducking
#8

blabla
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
leonard19941
Veteran Member
Join Date: Jun 2011
Old 07-01-2012 , 19:44   Re: Increase player speed when ducking
#9

Quote:
Originally Posted by ConnorMcLeod View Post
Any setting change without client's permission is slowhack.
Can even consider HLGuard as slowhacking.
So this would be considered SlowHack?
__________________

Last edited by ConnorMcLeod; 07-02-2012 at 15:48.
leonard19941 is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-02-2012 , 00:39   Re: Increase player speed when ducking
#10

Quote:
Originally Posted by ConnorMcLeod View Post
Any setting change without client's permission is slowhack.
Can even consider HLGuard as slowhacking.
__________________

Last edited by ConnorMcLeod; 07-02-2012 at 15:48.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Closed Thread



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:13.


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