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