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
addhook('use','zj_use')
function zj_use(id,x,y)
	if player(id, 'tilex') == 42 and player(id, 'tiley') == 21 then
		menu(id,"Restaurant,Food (+10hp)|$10,Meat (Gut Bomb)|$10")
	elseif player(id, 'tilex') == 59 and player(id, 'tiley') == 143 then
		menu(id,"Buy Handgun,Pistol|$55,Deagle|$60")
	end
end
addhook("menu", "zj_buy")
function zj_buy(id,title,button)
	if (title=="Restaurant") then
		if button == 1 then
			if player(id, 'money') >= 10 then
				parse('sethealth '.. id ..' '.. (player(id, 'health') + 10))
				parse('setmoney '.. id ..' '.. (player(id, 'money') - 10))
				msg2(id,'You successfully bought food for $10!')
			else
				msg2(id,'You need at least $10 to buy food!')
			end
		elseif button == 2 then
			if player(id, 'money') >= 10 then
				parse('equip '..id..' 86')
				parse('setweapon '..id..' 86')
				parse('setmoney '.. id ..' '.. (player(id, 'money') - 10))
				msg2(id,'You successfully bought meat for $10!')
			else
				msg2(id,'You need at least $10 to buy meat!')
			end
	elseif (title=="Buy Handgun") then
		if button == 1 then
			if player(id, 'money') >= 55 then
				parse('equip '..id..' 6')
				parse('setweapon '..id..' 6')
				parse('setmoney '.. id ..' '.. (player(id, 'money') - 55))
				msg2(id,'You successfully bought this weapon for $55!')
			else
				msg2(id,'You need at least $55 to buy this weapon!')
			end
		elseif button == 2 then
			if player(id, 'money') >= 60 then
				parse('equip '..id..' 3')
				parse('setweapon '..id..' 3')
				parse('setmoney '.. id ..' '.. (player(id, 'money') - 60))
				msg2(id,'You successfully bought this weapon for $60!')
			else
				msg2(id,'You need at least $60 to buy this weapon!')
			end
		end
	end
end