If you use the function in the map,then there is,
Put trigger - if,and care a there 'buy(<x>,<y>)', then will magic
In some strange way, the menu display will not display buttons!
Code.
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
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
function buy(x,y)
local v_menu = Menu.Add("Buy")
v_menu:DoClick(" : Primary ammo :| 200p ",function(ply)
if ply:GetMoney() > 200 then
ply:SetMoney(ply:GetMoney() - 200)
parse("spawnitem 61 " .. x .. " " .. y )
end
end)
v_menu:DoClick(" : Secendory ammo :| 150p ",function(ply)
if ply:GetMoney() > 150 then
ply:SetMoney(ply:GetMoney() - 150)
parse("spawnitem 62 " .. x .. " " .. y )
end
end)
for i,id in pairs(closeplayers(( x * 32 ) + 16,( y * 32 ) + 16,16)) do
local ply = Player.GetPlayerID(id)
ply:Menu("Buy")
-- menu(1,"hello,hi,he") - is not working
end
if type(closeplayers(( x * 32 ) + 16,( y * 32 ) + 16,16)) ~= "table" then return false else return true end
end
That's what I did on the map.
Help me please.
Problem solved.,
When you press use menu appeared with the name 'search'.
Well inattentive in
edited 1×, last 30.07.19 10:19:17 am