Loorenzos 0 Posted November 23, 2018 Hey im new with RageMP i was developping on FiveM before and i make an admin menu and so.. i have a question There is a way with NativeUI to do something like if UIMenuItem is Pressed then execute Function if yes how can i do because every ways i saw with nativeui was only in Boolean..... Share this post Link to post Share on other sites
Flow 17 Posted November 23, 2018 (edited) ui = new Menu("Test", "", new Point(1440, 20)); ui.AddItem(new UIMenuItem("do something", "description text")); ui.ItemSelect.on( (item, index) => { if(item.Text === "do something") mp.events.call("doSomeThing", player, options); }); Edited November 23, 2018 by cmdflow Share this post Link to post Share on other sites
Loorenzos 0 Posted November 23, 2018 (edited) 6 minutes ago, cmdflow said: ui = new Menu("Test", "", new Point(1440, 20)); ui.AddItem(new UIMenuItem("do something", "description text")); ui.ItemSelect.on( (item, index) => { if(item.Text === "do something") mp.events.call("doSomeThing", player, options); } yeah i saw this one but as i say its in boolean like if item == .... then ... but i want something that just detect if i pressed the button to execute my function Edited November 23, 2018 by Loorenzos Share this post Link to post Share on other sites
Flow 17 Posted November 23, 2018 (edited) I think i don't understand what you want to achieve because if you just want to press a button without having options then you simply do: ui.ItemSelect.on( (item, index) => { yourFancyFunction(); // or yourFanyFunction(item.text); } Edited November 23, 2018 by cmdflow Share this post Link to post Share on other sites
Loorenzos 0 Posted November 23, 2018 5 minutes ago, cmdflow said: I think i don't understand what you want to achieve because if you just want to press a button without having options then you simply do: ui.ItemSelect.on( (item, index) => { yourFancyFunction(); // or yourFanyFunction(item.text); } I will test that thx for ur help and sry ^^ i just started to learn the ragemp api Share this post Link to post Share on other sites
Flow 17 Posted November 23, 2018 Nothing to be sorry for. Hope i could help you. Have a good one Share this post Link to post Share on other sites
Loorenzos 0 Posted November 24, 2018 (edited) It work well thx ^^ btw if u wanna follow my project : https://trello.com/b/Nwv2uB1e/santosrp-ragemp Edited November 24, 2018 by Loorenzos Share this post Link to post Share on other sites