-
Notifications
You must be signed in to change notification settings - Fork 2
/
Class1.cs
159 lines (141 loc) · 5.75 KB
/
Class1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Native UI Menu Template 3.0 - Abel Software
// You must download and use Scripthook V Dot Net Reference and NativeUI Reference (LINKS AT BOTTOM OF THE TEMPLATE)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Linq;
using System.Text;
using GTA;
using GTA.Native;
using NativeUI;
using Corale.Colore.Core;
using Corale.Colore.Razer.Keyboard;
using Color = Corale.Colore.Core.Color;
public class NativeUITemplate : Script
{
private Ped playerPed = Game.Player.Character;
private Player player = Game.Player;
private MenuPool _menuPool;
Key[] healthKeys = { Key.Num8, Key.Num9, Key.Num4, Key.Num5, Key.Num6, Key.Num1, Key.Num2, Key.Num3 };
public void PlayerModelMenu(UIMenu menu)
{
var playermodelmenu = _menuPool.AddSubMenu(menu, "Debug");
for (int i = 0; i < 1; i++) ;
var addHealth = new UIMenuItem("Add Health", "");
var removeHealth = new UIMenuItem("-10 Health", "");
var malecop = new UIMenuItem(playerPed.Health.ToString(), "");
playermodelmenu.AddItem(addHealth);
playermodelmenu.AddItem(removeHealth);
playermodelmenu.AddItem(malecop);
playermodelmenu.OnItemSelect += (sender, item, index) =>
{
if (item == addHealth)
{
playerPed.Health = playerPed.MaxHealth;
malecop.Text = playerPed.Health.ToString();
}
if (item == removeHealth)
{
playerPed.Health = playerPed.Health - 10;
malecop.Text = playerPed.Health.ToString();
}
};
}
//Now we will add all of our sub menus into our main menu, and set the general information of the entire menu
public NativeUITemplate()
{
playerPed.AlwaysDiesOnLowHealth = false;
_menuPool = new MenuPool();
var mainMenu = new UIMenu("~g~Razer ~w~V", "~w~Mod by TheWolf! ~r~V 1.0");
_menuPool.Add(mainMenu);
PlayerModelMenu(mainMenu); //Here we add the Player Model Sub Menu
_menuPool.RefreshIndex();
//This code will run with every ms tick
Tick += OnTick;
//This code will open the menu
KeyDown += (o, e) =>
{
if (e.KeyCode == Keys.F6 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch
mainMenu.Visible = !mainMenu.Visible;
};
var keyboard = Keyboard.Instance;
Key[] otherPlayerKeys = { Key.A, Key.S, Key.D, Key.Space, Key.LeftShift, Key.V, Key.F };
keyboard.SetKeys(Color.White, Key.W, otherPlayerKeys);
}
private void OnTick(object sender, EventArgs e)
{
_menuPool.ProcessMenus();
var keyboard = Keyboard.Instance;
//Check Player Health and change NumPad Colors
#region
if (Enumerable.Range(200, 171).Contains(playerPed.Health))
{
keyboard.SetKeys(Color.Green, Key.Num7, healthKeys);
}
else if (Enumerable.Range(170, 151).Contains(playerPed.Health))
{
keyboard.SetKeys(Color.Yellow, Key.Num7, healthKeys);
}
else if (Enumerable.Range(150, 131).Contains(playerPed.Health))
{
keyboard.SetKeys(Color.Orange, Key.Num7, healthKeys);
}
else if (Enumerable.Range(130, 100).Contains(playerPed.Health))
{
keyboard.SetKeys(Color.Red, Key.Num7, healthKeys);
}
#endregion
if (player.WantedLevel == 0)
{
keyboard.SetKey(Key.D1, Corale.Colore.Core.Color.Black, false);
keyboard.SetKey(Key.D2, Color.Black, false);
keyboard.SetKey(Key.D3, Color.Black, false);
keyboard.SetKey(Key.D4, Color.Black, false);
keyboard.SetKey(Key.D5, Color.Black, false);
}
else if (player.WantedLevel == 1)
{
keyboard.SetKey(Key.D1, Color.Red, false);
}
else if (player.WantedLevel == 2)
{
keyboard.SetKey(Key.D1, Color.Red, false);
keyboard.SetKey(Key.D2, Color.Blue, false);
}
else if (player.WantedLevel == 3)
{
keyboard.SetKey(Key.D1, Color.Red, false);
keyboard.SetKey(Key.D2, Color.Blue, false);
keyboard.SetKey(Key.D3, Color.Red, false);
}
else if (player.WantedLevel == 4)
{
keyboard.SetKey(Key.D1, Color.Red, false);
keyboard.SetKey(Key.D2, Color.Blue, false);
keyboard.SetKey(Key.D3, Color.Red, false);
keyboard.SetKey(Key.D4, Color.Blue, false);
}
else if (player.WantedLevel == 5)
{
keyboard.SetKey(Key.D1, Color.Red, false);
keyboard.SetKey(Key.D2, Color.Blue, false);
keyboard.SetKey(Key.D3, Color.Red, false);
keyboard.SetKey(Key.D4, Color.Blue, false);
keyboard.SetKey(Key.D5, Color.Red, false);
}
if (player.IsAlive == false)
{
}
if (player.IsAiming)
{
Key[] otherPlayerKeys = { Key.Space, Key.V, Key.F };
keyboard.SetKeys(Color.Black, Key.LeftShift, otherPlayerKeys);
}
else
{
Key[] otherPlayerKeys = { Key.A, Key.S, Key.D, Key.Space, Key.LeftShift, Key.V, Key.F };
keyboard.SetKeys(Color.White, Key.W, otherPlayerKeys);
}
}
}