Jump to content
RAGE Multiplayer Community

Nativeui ussage

Recommended Posts


i understand slider, checkbox but don't understand how to set data on  list items 

i new to rage scripting and i wish to understand better how things work :) 

ui.AddItem(new UIMenuListItem(
  "menu item text",
	"menu item description goes here",
  new ItemsCollection(["erty", "abc"]),
// i understand how to add items but how set data for them because 
ui.ItemSelect.on(item => {
	if (item instanceof UIMenuListItem) {
    console.log(item.SelectedItem.DisplayText, item.SelectedItem.Data);
    mp.game.graphics.notify(`"${item.Text}". ${item.SelectedItem.Data}`);
// i get data as nill or null 

	} else if (item instanceof UIMenuSliderItem) {
    console.log(item.Text, item.Index, item.IndexToItem(item.Index));
    mp.game.graphics.notify(`text "${item.Text}". index  ${item.Index} indextoitem ${item.IndexToItem(item.Index)}`);
	} else {


Link to post
Share on other sites
  • 1 month later...
mp.events.add("loop",(=> {
 let amount = 1;
  let data= [{name: "w", price: 200}, {name: "w", price: 200}];
 let array [0, 1, 2, 3, 4, 5, 6, 7, 8];
  const native new Menu("HELLO WORLD"" ", resolution);
    let list = new UIMenuListItem("list""something.."new ItemsCollection(array));
  data.forEach(item => {
    let _item = new UIMenuItem("name: " + item.name, "price: " + item.price);
    native.ListChange.on((itemindex=> {
        amount = index 1;
Edited by offsetx
  • Mask 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...