Raised This Month: $32 Target: $400
 8% 

Make csgo ladder as in cs 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silvsilver
Member
Join Date: Oct 2017
Old 11-20-2017 , 21:29   Make csgo ladder as in cs 1.6
Reply With Quote #1

Hello, I request a plugin wich make you stick to a ladder without holding any movement key (CSGO).
Also some ladders you can't just walk up to, you need to jump on them.

Another guy request the same thing, and he got no respone, is it possible?
https://forums.alliedmods.net/showthread.php?t=289599

Tested this command:
https://forums.alliedmods.net/showthread.php?t=271610
Silvsilver is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 11-23-2017 , 19:33   Re: Make csgo ladder as in cs 1.6
Reply With Quote #2

I've been trying to bring back some of movement from 1.6 (sticky ladders, doubleducking, stand-up bhop, etc.) Here is the sticky ladder part from my plugin. There must be another, concrete way to have sticky ladders, but hey, it works!
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define PLUGIN_VERSION "1.01"

#pragma semicolon 1
#pragma newdecls required

float frametime;

public 
Plugin myinfo 
{
    
name "Sticky ladders"
    
author "juice"
    
description "Make players stick to ladders without holding any movement key"
    
version PLUGIN_VERSION
    
url "https://github.com/juicejuicejuice"
};

public 
void OnPluginStart()
{
    
frametime GetTickInterval();
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_PreThinkOnPlayerPreThink_Pre);
}

public 
void OnClientDisconnect(int client)
{
    
SDKUnhook(clientSDKHook_PreThinkOnPlayerPreThink_Pre);
}

public 
Action OnPlayerPreThink_Pre(int client)
{
    if (!
IsPlayerAlive(client))
    {
        return;
    }
    
    if (
GetEntityMoveType(client) == MOVETYPE_WALK)
    {
        
float velocity[3];
        
GetEntPropVector(clientProp_Data"m_vecAbsVelocity"velocity);
        
        if (!
velocity[0] && !velocity[1] && !velocity[2])
        {
            return;
        }
        
        
float origin[3];
        
GetClientAbsOrigin(clientorigin);
        
        
float mins[3], maxs[3];
        
GetEntPropVector(clientProp_Send"m_vecMins"mins);
        
GetEntPropVector(clientProp_Send"m_vecMaxs"maxs);
        
        
float wishpos[3];
        
wishpos[0] = origin[0] + velocity[0] * frametime;
        
wishpos[1] = origin[1] + velocity[1] * frametime;
        
wishpos[2] = origin[2] + velocity[2] * frametime;
        
        
Handle tr TR_TraceHullFilterEx(originwishposminsmaxsMASK_PLAYERSOLIDTraceFilter_IgnoreSelfclient);
        
        if (
TR_DidHit(tr))
        {
            
float planeNormal[3];
            
TR_GetPlaneNormal(trplaneNormal);
            
SetEntityMoveType(clientMOVETYPE_LADDER);
            
SetEntPropVector(clientProp_Send"m_vecLadderNormal"planeNormal);
        }
        
        
CloseHandle(tr);
    }
}

public 
bool TraceFilter_IgnoreSelf(int entint maskany data)
{
    return (
ent != data);


Last edited by lazarev; 06-08-2018 at 00:07. Reason: Updated source code to 1.01
lazarev is offline
Silvsilver
Member
Join Date: Oct 2017
Old 11-24-2017 , 19:01   Re: Make csgo ladder as in cs 1.6
Reply With Quote #3

Work most of the time, but some times you just don't stick to a ladder. Is the a away to be able to stick to it 99% of the time.

BTW thanxs. I think the hide n seek no block community will thanx your for this!
Silvsilver is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 11-25-2017 , 02:31   Re: Make csgo ladder as in cs 1.6
Reply With Quote #4

Nice plugin, I would've thought it messes with other situations when you hit a wall without a ladder but it works great. I modified it slightly to use m_vecAbsVelocity instead of m_vecVelocity and also added a check to see if the vel was 0, so as not to waste time doing traceray if they aren't moving. Other than that I couldn't find any situations where it doesn't stick.

Last edited by hmmmmm; 11-25-2017 at 02:31.
hmmmmm is offline
Silvsilver
Member
Join Date: Oct 2017
Old 11-25-2017 , 06:27   Re: Make csgo ladder as in cs 1.6
Reply With Quote #5

Quote:
Originally Posted by hmmmmm View Post
Nice plugin, I would've thought it messes with other situations when you hit a wall without a ladder but it works great. I modified it slightly to use m_vecAbsVelocity instead of m_vecVelocity and also added a check to see if the vel was 0, so as not to waste time doing traceray if they aren't moving. Other than that I couldn't find any situations where it doesn't stick.
Can you send me your code?
Silvsilver is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 11-25-2017 , 07:56   Re: Make csgo ladder as in cs 1.6
Reply With Quote #6

Can you tell me in what situations it doesnt stick? Pretty much only change I made is change m_vecVelocity to m_vecAbsVelocity, but I'm not sure if that would fix your issues. If you have a specific map where it doesn't work I', happy to investigate it further, and maybe work on other ladder issues.
hmmmmm is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 06-12-2018 , 12:40   Re: Make csgo ladder as in cs 1.6
Reply With Quote #7

There's simpler solution:
PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "2.0"

public Plugin myinfo 
{
    
name "Sticky ladders"
    
author "juice"
    
description "Stick to ladders without holding strafe keys"
    
version PLUGIN_VERSION
    
url "https://github.com/juicejuicejuice"
};

ConVar sm_sticky_ladders;

public 
void OnPluginStart()
{
    
sm_sticky_ladders CreateConVar("sm_sticky_ladders""1""Enable sticky ladders");
}

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat move[3], float angles[3], int &weaponint &subtypeint &cmdnumint &tickcountint &seedint mouse[2])
{
    if (!
sm_sticky_ladders.BoolValue || !IsPlayerAlive(client) || GetEntityMoveType(client) != MOVETYPE_WALK)
    {
        return 
Plugin_Continue;
    }
    
    if (!
move[0] && !move[1])
    {
        
float wishdir[3];
        
GetEntPropVector(clientProp_Data"m_vecAbsVelocity"wishdir);
        
        if (
wishdir[0] || wishdir[1] || wishdir[2])
        {
            
NormalizeVector(wishdirwishdir);
            
NegateVector(wishdir);
            
SetEntPropVector(clientProp_Data"m_vecLadderNormal"wishdir);
            
SetEntityMoveType(clientMOVETYPE_LADDER);
        }
    }
    
    return 
Plugin_Continue;

lazarev is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 06-20-2018 , 02:43   Re: Make csgo ladder as in cs 1.6
Reply With Quote #8

Quote:
Originally Posted by lazarev View Post
There's simpler solution:
PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "2.0"

public Plugin myinfo 
{
    
name "Sticky ladders"
    
author "juice"
    
description "Stick to ladders without holding strafe keys"
    
version PLUGIN_VERSION
    
url "https://github.com/juicejuicejuice"
};

ConVar sm_sticky_ladders;

public 
void OnPluginStart()
{
    
sm_sticky_ladders CreateConVar("sm_sticky_ladders""1""Enable sticky ladders");
}

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat move[3], float angles[3], int &weaponint &subtypeint &cmdnumint &tickcountint &seedint mouse[2])
{
    if (!
sm_sticky_ladders.BoolValue || !IsPlayerAlive(client) || GetEntityMoveType(client) != MOVETYPE_WALK)
    {
        return 
Plugin_Continue;
    }
    
    if (!
move[0] && !move[1])
    {
        
float wishdir[3];
        
GetEntPropVector(clientProp_Data"m_vecAbsVelocity"wishdir);
        
        if (
wishdir[0] || wishdir[1] || wishdir[2])
        {
            
NormalizeVector(wishdirwishdir);
            
NegateVector(wishdir);
            
SetEntPropVector(clientProp_Data"m_vecLadderNormal"wishdir);
            
SetEntityMoveType(clientMOVETYPE_LADDER);
        }
    }
    
    return 
Plugin_Continue;

This generates unexpected ladder sounds when I'm not on a ladder.

Edit: I made a 0.1 repeating timer and it seems to remove the sound bug.
__________________

Last edited by LenHard; 06-20-2018 at 05:58.
LenHard is offline
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 06-21-2018 , 06:34   Re: Make csgo ladder as in cs 1.6
Reply With Quote #9

Is there any way to make doubleduck like in cs16?
waylander3 is offline
Reply


Thread Tools
Display Modes

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 08:19.


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