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
items = {
	[1] = {
		name = "m3",
		cost = 10000,
	},
	[2] = {
		name = "Night Vision",
		cost = 5000,
	},
	[3] = {
		name = "Light Armor",
		cost = 15000,
	}
}
shop = {}
shop.location = {
	[1] = {
		x = 19,
		y = 18,
	},
	[2] = {
		x = 50,
		y = 18,
	},
	[3] = {
		x = 89,
		y = 15,
	},
	[4] = {
		x = 90,
		y = 15,
	}
}
addhook("use","shop.use")
function shop.use(id)
	if player(id,'tilex') == shop.location[1].x and player(id,'tiley') == shop.location[1].y or player(id,'tilex') == shop.location[2].x and player(id,'tiley') == shop.location[2].y or player(id,'tilex') == shop.location[3].x and player(id,'tiley') == shop.location[3].y or player(id,'tilex') == shop.location[4].x and player(id,'tiley') == shop.location[4].y then
		menu(id,'SHOP,M3|$10000,NightVision|$5000,Light Armor|$15000')
	end
end
addhook("menu","shop_menu")
function shop_menu(id,tit,but)
if tit == "SHOP" then
if but == 1 then
if player(id,'money')>= items[1].cost then
parse('setmoney '..id..' '..player(id,'money')-items[1].cost)
parse('equip '..id..' 10')
end
end
if but == 2 then
if player(id,'money')>=items[2].cost then
parse('setmoney '..id..' '..player(id,'money')-items[2].cost)
parse('equip '..id..' 59')
end
end
if but == 3 then
if player(id,'money')>=items[3].cost then
parse('setmoney '..id..' '..player(id,'money')-items[3].cost)
parse('equip '..id..' 79')
end
end
end
end