mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
rate limit sm_glock, sm_usp, and sm_knife
This commit is contained in:
parent
28e9d4029b
commit
82918f1945
@ -76,6 +76,7 @@ char gS_PreviousMap[PLATFORM_MAX_PATH];
|
||||
int gI_Style[MAXPLAYERS+1];
|
||||
Function gH_AfterWarningMenu[MAXPLAYERS+1];
|
||||
bool gB_ClosedKZCP[MAXPLAYERS+1];
|
||||
int gI_LastWeaponTick[MAXPLAYERS+1];
|
||||
|
||||
ArrayList gA_Checkpoints[MAXPLAYERS+1];
|
||||
int gI_CurrentCheckpoint[MAXPLAYERS+1];
|
||||
@ -1265,6 +1266,8 @@ public void OnClientPutInServer(int client)
|
||||
SDKHook(client, SDKHook_WeaponDrop, OnWeaponDrop);
|
||||
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
|
||||
|
||||
gI_LastWeaponTick[client] = GetGameTickCount();
|
||||
|
||||
if(IsFakeClient(client))
|
||||
{
|
||||
if (gCV_BotFootsteps.BoolValue && gH_UpdateStepSound != null)
|
||||
@ -1832,6 +1835,13 @@ public Action Command_Weapon(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
if (GetGameTickCount() - gI_LastWeaponTick[client] < 10)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
gI_LastWeaponTick[client] = GetGameTickCount();
|
||||
|
||||
char sCommand[16];
|
||||
GetCmdArg(0, sCommand, 16);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user