From 324b5c55ae4a932f9208d673977767dcb97cdea1 Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 30 May 2018 16:24:02 +0200 Subject: [PATCH] SelectiveBhop: Add a status command. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fuck you dogan, let me game in peace. K tnx bye. (ノಠ益ಠ)ノ彡┻━┻ --- SelectiveBhop/scripting/SelectiveBhop.sp | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/SelectiveBhop/scripting/SelectiveBhop.sp b/SelectiveBhop/scripting/SelectiveBhop.sp index 9e26887e..15e96578 100644 --- a/SelectiveBhop/scripting/SelectiveBhop.sp +++ b/SelectiveBhop/scripting/SelectiveBhop.sp @@ -57,6 +57,8 @@ public void OnPluginStart() RegAdminCmd("sm_bhop", Command_Bhop, ADMFLAG_GENERIC, "sm_bhop <#userid|name> <0|1>"); + RegConsoleCmd("sm_bhopstatus", Command_Status, "sm_bhopstatus [#userid|name]"); + /* Late load */ for(int i = 1; i <= MaxClients; i++) { @@ -330,6 +332,43 @@ public Action Command_Bhop(int client, int argc) return Plugin_Handled; } +public Action Command_Status(int client, int argc) +{ + if (argc && CheckCommandAccess(client, "", ADMFLAG_BAN, true)) + { + char sArgument[64]; + GetCmdArg(1, sArgument, sizeof(sArgument)); + + int target = -1; + if((target = FindTarget(client, sArgument, true, false)) == -1) + return Plugin_Handled; + + if(IsBhopLimited(target)) + { + ReplyToCommand(client, "[SM] %N their bhop is currently: limited", target); + return Plugin_Handled; + } + else + { + ReplyToCommand(client, "[SM] %N their bhop is currently: unlimited", target); + return Plugin_Handled; + } + } + else + { + if(IsBhopLimited(client)) + { + ReplyToCommand(client, "[SM] your bhop is currently: limited"); + return Plugin_Handled; + } + else + { + ReplyToCommand(client, "[SM] your bhop is currently: unlimited"); + return Plugin_Handled; + } + } +} + public int Native_LimitBhop(Handle plugin, int numParams) { int client = GetNativeCell(1);