Announcement

Collapse
No announcement yet.

Dynamic FAST-WALK (Silent-Run)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic FAST-WALK (Silent-Run)

    Code By: darkko

    I made this a months ago, you can put this in CreateMove, HUD_Redraw, HUD_PostRunCmd, etc... (no idea if this was made before)...

    The idea of this is do NOT go more than 149 units per second, or else your will make steps sounds.

    The reason of cl_movespeedkey cvar is to make CS 1.6 p47 more compatible, btw this works too on CS 1.6 p48.

    You can turn around with the mouse, move is sideways, make the Fast Wall Run / Fast Run Technique and you will still run at 149 u/s...

    Code:
    if ( cvar.kzh_fastwalk )
    {
    static int ForwardSpeed, BackSpeed, SideSpeed = 0;
    
    if ( GetAsyncKeyState ( VK_LSHIFT ) & 0x8000 )
    {
    double WalkSpeed = 149 / ppmove->maxspeed;
    pEngfuncs->pfnGetCvarPointer ( "cl_movespeedkey" )->value = WalkSpeed;
    
    if ( ppmove->flags & FL_ONGROUND )
    {
    Vector Velocity = ppmove->velocity;
    int Speed = abs ( (int) roundf ( sqrt ( Velocity[0] * Velocity[0] + Velocity[1] * Velocity[1] ) ) );
    
    if ( Speed <= 0 ) { ForwardSpeed = 149; BackSpeed = 149; SideSpeed = 149; }
    if ( Speed > 200 ) { ForwardSpeed -= 11; BackSpeed -= 11; SideSpeed -= 11; }
    if ( Speed > 149 && Speed < 200 ) { ForwardSpeed -= 13; BackSpeed -= 13; SideSpeed -= 13; }
    if ( Speed < 149 && Speed > 0 ) { ForwardSpeed++; BackSpeed++; SideSpeed++; }
    
    if ( ForwardSpeed < 1 ) ForwardSpeed = 1;
    if ( BackSpeed < 1 ) BackSpeed = 1;
    if ( SideSpeed < 1 ) SideSpeed = 1;
    
    pEngfuncs->pfnGetCvarPointer ( "cl_forwardspeed" )->value = ForwardSpeed;
    pEngfuncs->pfnGetCvarPointer ( "cl_backspeed" )->value = BackSpeed;
    pEngfuncs->pfnGetCvarPointer ( "cl_sidespeed" )->value = SideSpeed;
    }
    }
    
    else
    {
    ForwardSpeed = 400; pEngfuncs->pfnGetCvarPointer ( "cl_forwardspeed" )->value = ForwardSpeed;
    BackSpeed = 400; pEngfuncs->pfnGetCvarPointer ( "cl_backspeed" )->value = BackSpeed;
    SideSpeed = 400; pEngfuncs->pfnGetCvarPointer ( "cl_sidespeed" )->value = SideSpeed;
    pEngfuncs->pfnGetCvarPointer ( "cl_movespeedkey" )->value = 0.52;
    }
    }
Working...
X