View Single Post
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