Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local item_id = 6948
- -- local menu_id = 1 -- unused
- function Item_Hello(event, player, item)
- -- NOTE; THIS IS ALWAYS NEEDED HERE IN PLAYER GOSSIP:
- player:GossipClearMenu()
- player:GossipMenuAddItem(0, "menu 1", 0, 1, 0)
- player:GossipMenuAddItem(0, "menu 2", 0, 2, 0)
- player:GossipSendMenu(1, player, 333) -- Note player and 333, same as in register
- end
- local function OnSelect(event, player, player, sender, intid, code, menu_id)
- if(intid == 1) then
- player:GossipMenuAddItem(0, "worked 1", 0, 2, 0)
- player:GossipSendMenu(1, player, menu_id) -- can use menu_id or 333 .. or different number too, if you want to register the menu actions to another function
- end
- if(intid == 2) then
- player:GossipMenuAddItem(0, "worked 2", 0, 2, 0)
- player:GossipSendMenu(1, player, menu_id)
- end
- -- Item_Hello(event, player) -- Shows main menu (event is 2)
- end
- RegisterItemGossipEvent(item_id, 1, Item_Hello)
- RegisterPlayerGossipEvent(333, 2, OnSelect) -- GOSSIP_EVENT_ON_SELECT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement