rate limit sm_glock, sm_usp, and sm_knife

This commit is contained in:
rtldg 2021-07-04 11:01:34 +00:00
parent 28e9d4029b
commit 82918f1945

View File

@ -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);