Raised This Month: $12 Target: $400
 3% 

Solved [CSGO] Weird Bhop. ReplicateToClient


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cruze
Veteran Member
Join Date: May 2017
Old 10-20-2018 , 10:46   [CSGO] Weird Bhop. ReplicateToClient
Reply With Quote #1

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <cstrike>

bool g_bToggle[MAXPLAYERS+1] = false;
ConVar sv_autobunnyhopping;


public 
Plugin myinfo =
{
    
name "[CSGO] Per Player Bhop Toggle",
    
author "Cruze",
    
description "",
    
version "1.0",
    
url ""
};


public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_bhop"CMD_Bhop"Toggle Bhop.");
    
sv_autobunnyhopping FindConVar("sv_autobunnyhopping");
    
sv_autobunnyhopping.BoolValue false;
}

public 
Action CMD_Bhop(int clientint args)
{
    if(!
IsClientValid(client) || !IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    if(!
g_bToggle[client])
    {
        
sv_autobunnyhopping.ReplicateToClient(client"1");
        
PrintToChat(client"Enabled Autobhop for you");
        
g_bToggle[client] = true;
    }
    else
    {
        
sv_autobunnyhopping.ReplicateToClient(client"0");
        
PrintToChat(client"Disabled Autobhop for you");
        
g_bToggle[client] = false;
    }
    return 
Plugin_Handled;
}

bool IsClientValid(int client)
{
    return ((
client 0) && (client <= MaxClients));

I was trying per player autobhop but encountered something weird=> https://streamable.com/ifyus
Can someone tell me how can I make this work?
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 10-21-2018 at 09:37.
Cruze is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-20-2018 , 13:14   Re: [CSGO] Weird Bhop. ReplicateToClient
Reply With Quote #2

You can get auto bhop with sv_autobunnyhopping 0 and this code:
PHP Code:
#pragma newdecls required 

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public Action OnPlayerRunCmd(int client,int &buttons,int &impulsefloat vel[3], float angles[3],int &weapon)
{    
    if (
IsPlayerAlive(client))
    {
        if (
buttons IN_JUMP)
        {
            if (!(
GetEntityFlags(client) & FL_ONGROUND))
            {
                if (!(
GetEntityMoveType(client) & MOVETYPE_LADDER))
                {
                    if (
GetEntProp(clientProp_Data"m_nWaterLevel") <= 1)
                    {
                        
buttons &= ~IN_JUMP;
                    }
                }
            }
        }
    }
    
    return 
Plugin_Continue;

You can edit it to make it per client.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 10-20-2018 at 13:18.
Franc1sco is offline
Send a message via MSN to Franc1sco
Cruze
Veteran Member
Join Date: May 2017
Old 10-20-2018 , 13:51   Re: [CSGO] Weird Bhop. ReplicateToClient
Reply With Quote #3

Quote:
Originally Posted by Franc1sco View Post
You can get auto bhop with sv_autobunnyhopping 0 and this code:
PHP Code:
#pragma newdecls required 

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public Action OnPlayerRunCmd(int client,int &buttons,int &impulsefloat vel[3], float angles[3],int &weapon)
{    
    if (
IsPlayerAlive(client))
    {
        if (
buttons IN_JUMP)
        {
            if (!(
GetEntityFlags(client) & FL_ONGROUND))
            {
                if (!(
GetEntityMoveType(client) & MOVETYPE_LADDER))
                {
                    if (
GetEntProp(clientProp_Data"m_nWaterLevel") <= 1)
                    {
                        
buttons &= ~IN_JUMP;
                    }
                }
            }
        }
    }
    
    return 
Plugin_Continue;

You can edit it to make it per client.
Thanks! But I know about this method. I wanted ReplicateToClient/SendConVarValue to work because sv_autobunnyhopping 1 cause no bhop lag for high pingers..
__________________
Taking paid private requests! Contact me
Cruze is offline
ofir753
Senior Member
Join Date: Aug 2012
Old 10-20-2018 , 15:42   Re: [CSGO] Weird Bhop. ReplicateToClient
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=289075
ofir753 is offline
Cruze
Veteran Member
Join Date: May 2017
Old 10-21-2018 , 00:41   Re: [CSGO] Weird Bhop. ReplicateToClient
Reply With Quote #5

Quote:
Originally Posted by ofir753 View Post
Thank you so much ofir! Will try it later
edit: Working like a charm, thanks again ofir!!
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 10-21-2018 at 09:41. Reason: edit: Worked.
Cruze 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 09:04.


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