|
Senior Member
|
06-20-2018
, 02:43
Re: Make csgo ladder as in cs 1.6
|
#8
|
Quote:
Originally Posted by lazarev
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 client, int &buttons, int &impulse, float move[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int 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(client, Prop_Data, "m_vecAbsVelocity", wishdir); if (wishdir[0] || wishdir[1] || wishdir[2]) { NormalizeVector(wishdir, wishdir); NegateVector(wishdir); SetEntPropVector(client, Prop_Data, "m_vecLadderNormal", wishdir); SetEntityMoveType(client, MOVETYPE_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.
|
|
|
|