Now this is for CS:S, but it should work on other games (not TF2 though, I don't think).
You could make a global array of ints that stores the time at which a client last fired his weapon, then compare it with the current time and do the magic.
Something like:
PHP Code:
new g_iClientLastWeaponShoot[MAXPLAYERS + 1];
public OnPluginStart()
{
HookEvent("weapon_fire", Event_WeaponFire);
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
g_iClientLastWeaponShoot[GetClientOfUserId(GetEventInt(event, "userid"))] = 0;
}
public Action:Event_WeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (g_iClientLastWeaponShoot[client] != 0)
{
if (GetTime() - g_iClientLastWeaponShoot[client] >= 3)
{
KickClient(client);
}
}
}
This is very simple, but it should get the idea across.
__________________