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

Block player from spamming jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
midnight9
Senior Member
Join Date: Nov 2012
Old 03-20-2017 , 16:13   Block player from spamming jump
Reply With Quote #1

Hello, im wondering if anyone could help me figure out how to block jump spam (mousewheel. macros etc.) I found this plugin:
Code:
#include <sourcemod>
#define PL_VERSION "1.1"
new bool:bBlockOnNextFrame[MAXPLAYERS + 1];
public Plugin myinfo =
{
 name = "BHop spam block",
 author = "sheo",
 description = "Fixes jump command spam to prevent too easy bunnyhopping",
 version = PL_VERSION,
 url = "http://steamcommunity.com/groups/b1com"
};
public OnPluginStart()
{
 decl String:gfstring[128];
 GetGameFolderName(gfstring, sizeof(gfstring));
 if (!StrEqual(gfstring, "left4dead2", false))
 {
  SetFailState("Plugin supports Left 4 dead 2 only!");
 }
 CreateConVar("l4d2_bhop_spam_block_version", PL_VERSION, "BHop spam block version", FCVAR_PLUGIN | FCVAR_NOTIFY);
}
public OnClientPutInServer(client)
{
 bBlockOnNextFrame[client] = false;
}
public OnClientDisconnect(client)
{
 bBlockOnNextFrame[client] = false;
}
public Action:OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
{
 if (bBlockOnNextFrame[client])
 {
  bBlockOnNextFrame[client] = false;
  SetEntPropFloat(client, Prop_Send, "m_jumpSupressedUntil",  GetGameTime() + 0.4);
 }
 if ((buttons & IN_JUMP) && IsClientInGame(client) && !IsFakeClient(client) && (IsPlayerAlive(client) || GetEntProp(client, Prop_Send, "m_isGhost") == 1))
 {
  if (GetGameTime() >= GetEntPropFloat(client, Prop_Send, "m_jumpSupressedUntil"))
  {
   bBlockOnNextFrame[client] = true;
  }
  else if (GetClientTeam(client) == 3)
  {
   buttons = (buttons & ~IN_JUMP);
  }
 }
 return Plugin_Continue;
}
It does work, but not the way i want it, as it delays the next jumps instead of cancelling it, meaning if i hold jump (spacebar) i will be jumping continuously every 0.4s. So i would like to make it to cancel any jumps done within 0.4seconds from the last successful jump and only fire the jump after that time.
I would ask the author of this plugin but he seems to be inactive (Last Activity: 12-08-16)

Regards
midnight9 is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 06-08-2017 , 23:23   Re: Block player from spamming jump
Reply With Quote #2

Hello,

i have found on your server M1 & Bhop AutoTrigger Detector" (0.2) by Visor, SMAC Dev Team, Midnight

can you share?

Regards,
eric0279 is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 06-08-2017 , 23:49   Re: Block player from spamming jump
Reply With Quote #3

Try this
https://github.com/Bara20/AntiDuckJumpSpam
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 06-09-2017 , 03:57   Re: Block player from spamming jump
Reply With Quote #4

Thanks but i don't use SM 1.7 / 1.8, sorry.
eric0279 is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-01-2017 , 18:51   Re: Block player from spamming jump
Reply With Quote #5

Why not? It's alot better.
cigzag 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 07:17.


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