AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Make csgo ladder as in cs 1.6 (https://forums.alliedmods.net/showthread.php?t=303060)

Silvsilver 11-20-2017 21:29

Make csgo ladder as in cs 1.6
 
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

lazarev 11-23-2017 19:33

Re: Make csgo ladder as in cs 1.6
 
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! :bacon:
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);



Silvsilver 11-24-2017 19:01

Re: Make csgo ladder as in cs 1.6
 
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! :)

hmmmmm 11-25-2017 02:31

Re: Make csgo ladder as in cs 1.6
 
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.

Silvsilver 11-25-2017 06:27

Re: Make csgo ladder as in cs 1.6
 
Quote:

Originally Posted by hmmmmm (Post 2562637)
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?

hmmmmm 11-25-2017 07:56

Re: Make csgo ladder as in cs 1.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.

lazarev 06-12-2018 12:40

Re: Make csgo ladder as in cs 1.6
 
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;



LenHard 06-20-2018 02:43

Re: Make csgo ladder as in cs 1.6
 
Quote:

Originally Posted by lazarev (Post 2596572)
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.

waylander3 06-21-2018 06:34

Re: Make csgo ladder as in cs 1.6
 
Is there any way to make doubleduck like in cs16?


All times are GMT -4. The time now is 17:40.

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