addhook("usebutton","happy_town_use")
addhook("menu","happy_town_menu")
function happy_town_kill(killer,victim,weapon,x,y)
happy_town_warning[killer] = happy_town_warning[killer] + 1
msg2(killer,"[WARNING] Don't kill other player! unless they are (EVIL)!")
msg2(killer,"[WARNING] Warning "..happy_town_warning[killer].."/3")
if (happy_town_warning[killer]>=3) then
if (player(killer,"team")==2) then
parse("setpos "..killer.." 3340 142")
msg("["..player(killer,"name").."] has been jailed due to 3 of warning!")
parse("strip "..killer.." 0")
end
if (player(killer,"team")==1) then
parse("setpos "..killer.." 3340 243")
msg("["..player(killer,"name").."] has been jailed due to 3 of warning!")
parse("strip "..killer.." 0")
end
end
end
addhook("usebutton","happy_town_use")
function happy_town_use(id,x,y)
usgn = player(id,"usgn")
-- Admin Door's
if (x == 13 and y == 9) or (x == 15 and y == 9) or (x == 13 and y == 7) then
if (usgn == admin_usgn) then
parse("trigger admin_door")
else
msg2(id,"[Happy Town]: Only Admin can enter this building!")
end
end
addhook("usebutton","happy_town_use")
function happy_town_use(id,x,y)
usgn = player(id,"usgn")
-- Weaponmarket weapon's info
if (x == 18 and y == 61 or x == 18 and y == 61 or x == 46 and y == 3 or x == 66 and y == 2 or x == 67 and y == 20 or x == 47 and y == 30 or x == 47 and y == 31 or x == 22 and y == 22 or x == 62 and y == 35 or x == 87 and y == 30 or x == 18 and y == 81 or x == 19 and y == 81 or x == 45 and y == 63 or x == 46 and y == 63 or x == 61 and y == 68 or x == 92 and y == 84 or x == 93 and y == 84 or x ==57 and y == 29 or x== 57 and y== 30 or x == 58 and y == 29 or x == 58 and y == 30 or x == 60 and y == 29 or x == 60 and y == 30 or x == 61 and y == 29 or x == 61 and y == 30 or x == 63 and y == 29 or x == 63 and y == 30 or x == 64 and y == 29 or x == 64 and y == 29 or x == 64 and y == 30) then
menu(id,"Eat/Drink Menu,Eat|30$,Drink|30$")
if (title == "Eat/Drink Menu") then
if (key == 1) then
if (happy_town_hunger[id] >= -45) then
happy_town_hunger[id] = happy_town_hunger[id] - 5
msg2(id,"[System] Eating")
happy_town_currency[id] = happy_town_currency[id] - 30
else
msg2(id,"[System] You're full!")
end
end
if (key == 2) then
if (happy_town_thirst[id] >= -45) then
happy_town_thirst[id] = happy_town_thirst[id] - 5
msg2(id,"[System] Drinking")
happy_town_currency[id] = happy_town_currency[id] - 30
else
msg2(id,"[System] You're full!")
end
end
end