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
stats = {
	['kills'] = {}
}
for i = 1, 32 do stats.kills[i] = 0
addhook('kill', 'AA_kill')
addhook('menu', 'AA_menu')
addhook('serveraction', 'AA_serveraction')
function AA_kill(id, victim)
	stats.kills[id] = stats.kills[id] + 1
end
function AA_menu(id, title, button)
	if title == 'Fragmenu' then
		if button == 1 then
			if _checkkills(id, 5) then
				parse('equip '..id..' 51')
			end
		elseif button == 2 then
			if _checkkills(id, 6) then
				parse('equip '..id..' 52')
			end
		elseif button == 3 then
			if _checkkills(id, 7) then
				parse('equip '..id..' 53')
			end
		end
	end
end
function AA_serveraction(id, action)
	if action == '1' then
		_fragmenu(id)
	end
end
function _checkkills(id, nr)
	if stats.kills[id] >= nr then
		stats.kills[id] = stats.kills[id] - nr
		return true
	else
		msg2(id, '©200050050You do not have enough frags to buy this item')
	end
end
function _fragmenu(id)
	menu(id, 'Fragmenu,HE|5 frags,Flash|6 frags,Smoke|7 frags)
end