Forum




is it possible to stop button spamming?
4 replies



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
spamprot = {} for i = 1, 32 do spamprot[i] = 0 end addhook('usebutton', 'AA_usebutton') function AA_usebutton(id, x, y) 	function respamprot(i) 		spamprot[i] = 0 	end 	if spamprot[id] ~= 1 then -- ALL BUTTON CODE AND SHIT YOU WANNA ADD 		spamprot[id] = 1 		timer(2000, 'respamprot', id) 	end end


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
spamprot = {} for i = 1, 32 do spamprot[i] = 0 end time=2 addhook("menu","_menu") function _menu(id,title,button) 	if spamprot[id]==0 then 		spamprot[id]=1 		timer(time*1000, 'reset_spamprot', id) 		--// YOUR MENUS HERE 		if title=="Menu of HH" then 			if button==1 then 				--//some code here 			elseif button==2 then 				--some code here 			end 		end 	end end function reset_spamprot(id) 	spamprot[id]=0 end
Not shortest, but should work.
edited 1×, last 12.07.12 11:21:04 am



