Untitled
unknown
plain_text
a year ago
1.3 kB
16
Indexable
using System;
using GTA;
using GTA.Native;
using GTA.Math;
using LemonUI;
using LemonUI.Menus;
public class WouldYouRather : Script
{
private ObjectPool menuPool;
private NativeMenu mainMenu;
public WouldYouRather()
{
Tick += OnTick;
KeyDown += OnKeyDown;
// Initialize menu
menuPool = new ObjectPool();
mainMenu = new NativeMenu("Would You Rather", "Choose an option");
// Add choices
mainMenu.Add(new NativeItem("Fight 10 cops unarmed"));
mainMenu.Add(new NativeItem("Fight 1 tank with a knife"));
mainMenu.Add(new NativeItem("Jump off Maze Bank naked"));
mainMenu.Add(new NativeItem("Survive 5-star wanted for 10 minutes"));
// Events
mainMenu.ItemSelected += (sender, item, index) =>
{
UI.Notify("You chose: " + item.Title);
};
menuPool.Add(mainMenu);
}
private void OnTick(object sender, EventArgs e)
{
menuPool.Process();
}
private void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
// Open menu with F5
if (e.KeyCode == System.Windows.Forms.Keys.F5)
{
mainMenu.Visible = !mainMenu.Visible;
}
}
}
Editor is loading...
Leave a Comment