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
function new_players_array()
local players = {}
for id=1,32 do
players[id] = {image = nil} -- player's "properties"
end
return players
end
players = new_players_array()
addhook('serveraction', 'mainmenu')
function mainmenu(id,action)
if ( action == 1 ) then
menu(id,"Hats,Hat #1|FREE,Hat #2|FREE,Hat #3|FREE,Hat #4|FREE,Hat #5|FREE,Hat #6|FREE,Hat #7|FREE,Hat #8|FREE")
end
end
addhook("menu", "mainmenu2")
function mainmenu2(id, title, but)
local player = players[id]
if title == "Hats" then
if (but==1) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/1.png",1,1,200+id)
return 1
end
if (but==2) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/2.png",1,1,200+id)
return 1
end
if (but==3) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/3.png",1,1,200+id)
return 1
end
if (but==4) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/4.png",1,1,200+id)
return 1
end
if (but==5) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/5.png",1,1,200+id)
return 1
end
if (but==6) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/6.png",1,1,200+id)
return 1
end
if (but==7) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/7.png",1,1,200+id)
return 1
end
if (but==8) then
if ( player.image ) then
freeimage(player.image)
player.image = nil
	 end
id=image("gfx/hats_menu/8.png",1,1,200+id)
return 1
end
end
end