Forum

> > CS2D > Scripts > spam
Forums overviewCS2D overview Scripts overviewLog in to reply

English spam

2 replies
To the start Previous 1 Next To the start

old spam

limonata
User Off Offline

Quote
Hello guys today I am tried to make anti-spam lua bu it doesnt work also there is no any error please help me where is my mistake?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
spam = {}
for i = 1,32 do 
spam[i] = 0
end
function respam(id)
spam[id] = 0
end
addhook("say","spam")
function spam(id)
if spam[id] == 0 then
spam[id] = 1
timer(4000, 'respam',id)
end
end

old Re: spam

mafia_man
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Player={}

addhook("say", "onSay")
function onSay(id, t)
	if not Player[id] then
		Player[id] = {spam = false}
	end
	
	if Player[id].spam then
		return 1
	else
		Player[id].spam = true
		timer(1000, "allowsay", id)
	end
end

function allowsay(id)
	id = tonumber(id)
	Player[id].spam = false
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview