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 client, int 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?
__________________