1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
function flood.hooksayteam(id,txt)
	if flood.savesay[id]==0 then flood.savesay[id]="empty" end
	t =string.lower(txt)
	if flood.savesayy[id]==t then
		flood.type[id]=3	-- WRITE MESSAGE SAME AS BEFORE (NEEDLESS/USELESS)
	elseif flood.savesayy[id]==string.reverse(t) then
		flood.type[id]=3	-- WRITE MESSAGE SAME AS BEFORE (NEEDLESS/USELESS)
	elseif string.len(txt)>flood.maxlenght then
		flood.type[id]=2	-- WRITE TOO LONG
		flood.savesay[id]=string.sub(txt,1,flood.maxlenght)
	elseif flood.sayduration[id]>=1 then
		flood.type[id]=1	-- STILL IN COOLDOWN
		flood.savesay[id]=txt
	elseif flood.sayduration[id]<=0 then
		flood.type[id]=0	-- NORMAL SAYING
		flood.savesayy[id]=t
	end
	if flood.type[id]==0 then
		flood.sayduration[id]=flood.saytcooldown
	end
	if flood.type[id]==1 then
		msg2(id,"\169255000000You can say in "..flood.sayduration[id].." second again.")
		msg2(id,"\169255255255Saved in draft. Say /serveraction3 to load your msg.")
		return 1
	end
	if flood.type[id]==2 then
		msg2(id,"\169255000000Your message is too long. We saved your msg as long as possible.")
		msg2(id,"\169255255255Saved in draft. Say /serveraction3 to load your msg.")
		return 1
	end
	if flood.type[id]==3 then
		msg2(id,"\169255000000Please dont write same thing as you say before.")
		return 1
	end
end
function flood.hookradio(id)
	if flood.radduration[id]<=0 then
		flood.radduration[id]=flood.radcooldown
	else
		msg2(id,"\169255000000Please do not flood / spam radio chat.")
		return 1
	end
end
function flood.menuact(id,action)
	if action==3 then
		if player(id,"health")>0 then
			if flood.savesay[id]=="empty" then				
				menu(id,"Draft & HUD,(Check draft|empty),(Sent draft|empty),,Toggle cooldown HUD|"..flood.hud[id]..",,Close")
			else
				menu(id,"Draft & HUD,Check Draft,Sent draft,,Toggle cooldown HUD|"..flood.hud[id]..",,Close")
			end
		end
	end
end
function flood.menu(id,title,button)
	if title=="Draft & HUD" then
		if button==1 then
			msg2(id,"\169200200200[Your draft]\169255255000 "..flood.savesay[id])
		end
		if button==2 then
			if flood.sayduration[id]<=0 then
				if player(id,"team")==1 then
					msg("\169200200200[Instant]\169255025000 "..player(id,"name")..": \169255220000"..flood.savesay[id])
				elseif player(id,"team")==2 then
					msg("\169200200200[Instant]\169050150255 "..player(id,"name")..": \169255220000"..flood.savesay[id])
				end
				flood.savesay[id]="empty"
			end
		end
		if button==4 then
			if flood.hud[id]=="True" then
				flood.hud[id]="False"
			else
				flood.hud[id]="True"
			end
		end
	end
end
function flood.hookdrop(id)
	if player(id,"health")>0 then
		if flood.dropduration[id]<=0 then
			flood.dropduration[id]=flood.dropcooldown
		else
			msg2(id,"\169255000000Please do not spam dropping items.")
			return 1
		end
	end
end
function flood.spawn(id)
	if flood.hud[id]=="True" then
		parse('hudtxt2 '..tonumber(id)..' 1 "©255255255Press F4 to access HUD menu." 442 10')
		parse('hudtxtalphafade 0 1 10000 0.0')
	end
end