Advertisement
Will_Redeemed

NativeUI Adding Button Variable Code

Aug 6th, 2016
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. -- actual code --
  2. var variablename = new UIMenuItem("Remove Wanted Level", "Lowers Wanted Level");
  3.         menu.AddItem(variablename);
  4.         menu.OnItemSelect += (sender, item, index) =>
  5.         {
  6.             if (item == variablename)
  7.             {
  8.                 Game.Player.IsInvincible = true;
  9.                 UI.Notify("Code Activated");
  10.             }
  11.         };
  12. -- non-code --
  13. you can change "variablename" to any solid name, like example "wantedlevel". that way it'd say "var wantedlevel".
  14. anything that has the variablename in it, change it to what you named the variable
  15. for instance, if you named the variable "level" you'd change the "var variablename" to "var level", you'd change "if (item == variablename)" to "if (item == level)" and "menu.AddItem(variablename);" to "menu.AddItem(level);"
  16. hope this clears it up.
  17. native database for where I got "Game.Player.IsInvincible" from:
  18. http://www.dev-c.com/nativedb/ (this is where I got all the natives and hashes from)
  19. https://github.com/Guad/NativeUI/blob/master/MenuExample.cs (this is where I got some of the regular code from)
  20. https://www.gta5-mods.com/tools/gta-v-script-creator (this is where I got the "Game.Player.IsInvincible" code from, the program itself includes the code.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement