Raised This Month: $ Target: $400
 0% 

[REQ] Anti Chat Flood


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 11-22-2019 , 13:27   Re: [REQ] Anti Chat Flood
Reply With Quote #9

Code:
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define MAX_FLOOD_REPEAT	4
#define MIN_FLOOD_TIME 		0.75
#define MIN_FLOOD_NEXT_TIME	4.0

new g_Flood[MAX_PLAYERS+1];
new Float:g_Flooding[MAX_PLAYERS+1];

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_clcmd("say","HookSay");
	register_clcmd("say_team","HookSay");
}

public HookSay(id)
{
	new Float:NexTime = get_gametime();
		
	if(g_Flooding[id] > NexTime)
	{
		if(g_Flood[id] >= MAX_FLOOD_REPEAT)
		{
			//client_print(id, print_center, "You flood the chat/console and mute for %d Seconds", g_Flood)
			g_Flooding[id] = NexTime + MIN_FLOOD_TIME + MIN_FLOOD_NEXT_TIME;
			return PLUGIN_HANDLED;
		}

		g_Flood[id]++;
	}
	else if(g_Flood[id])
	{
		g_Flood[id]--;
	}
		
	g_Flooding[id] = NexTime + MIN_FLOOD_TIME;

	return PLUGIN_CONTINUE;
}
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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 17:39.


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