-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnativeui.lua
More file actions
248 lines (229 loc) · 7.46 KB
/
nativeui.lua
File metadata and controls
248 lines (229 loc) · 7.46 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
_menuPool = NativeUI.CreatePool()
-- Create Main Menu to Select Department
mainMenu = NativeUI.CreateMenu("LEO Vehicle Menu", "~b~CRONUS GAMING LEO VEHICLES MENU")
_menuPool:Add(mainMenu)
vehMenu = false
function ShowNotification(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(false, false)
end
function sheriffMenu(menu)
local submenu = _menuPool:AddSubMenu(menu, "Sheriff Vehicles")
for i = 1, 1 do
local Item = NativeUI.CreateItem("Crown Victoria", "Spawn Sheriff CVPI")
Item.Activated = function(ParentMenu, SelectedItem)
spawnCar("sheriff")
end
local Item2 = NativeUI.CreateItem("Tahoe", "Spawn Sheriff Tahoe")
Item2.Activated = function(ParentMenu, SelectedItem)
spawnCar("sheriff2")
end
local Item3 = NativeUI.CreateItem("Charger", "Spawn Sheriff Charger")
Item3.Activated = function(ParentMenu, SelectedItem)
spawnCar("sheriff4")
end
local Item4 = NativeUI.CreateItem("Taurus", "Spawn Sheriff FPIS")
Item4.Activated = function(ParentMenu, SelectedItem)
spawnCar("sheriff5")
end
local Item5 = NativeUI.CreateItem("Explorer", "Spawn Sheriff FPIU")
Item5.Activated = function(ParentMenu, SelectedItem)
spawnCar("sheriff6")
end
submenu:AddItem(Item)
submenu:AddItem(Item2)
submenu:AddItem(Item3)
submenu:AddItem(Item4)
submenu:AddItem(Item5)
end
end
function fireMenu(menu)
local submenu = _menuPool:AddSubMenu(menu, "Fire Rescue Vehicles")
for i = 1, 1 do
local Item = NativeUI.CreateItem("Ladder", "Spawn FR Ladder Truck")
Item.Activated = function(ParentMenu, SelectedItem)
spawnCar("ladder4")
end
local Item2 = NativeUI.CreateItem("Engine", "Spawn FR Engine")
Item2.Activated = function(ParentMenu, SelectedItem)
spawnCar("firetruk2")
end
local Item3 = NativeUI.CreateItem("Engine 2", "Spawn FR Engine 2")
Item3.Activated = function(ParentMenu, SelectedItem)
spawnCar("firetruk4")
end
local Item4 = NativeUI.CreateItem("Rescue", "Spawn FR Rescue Truck")
Item4.Activated = function(ParentMenu, SelectedItem)
spawnCar("srescue1")
end
local Item5 = NativeUI.CreateItem("Ambulance", "Spawn FR Ambulance")
Item5.Activated = function(ParentMenu, SelectedItem)
spawnCar("ambulance")
end
submenu:AddItem(Item)
submenu:AddItem(Item2)
submenu:AddItem(Item3)
submenu:AddItem(Item4)
submenu:AddItem(Item5)
end
end
function swatMenu(menu)
local submenu = _menuPool:AddSubMenu(menu, "SWAT Vehicles")
for i = 1, 1 do
local Item = NativeUI.CreateItem("Bearcat", "Spawn SWAT Bearcat")
Item.Activated = function(ParentMenu, SelectedItem)
spawnCar("swat")
end
local Item2 = NativeUI.CreateItem("Tahoe", "Spawn SWAT Tahoe")
Item2.Activated = function(ParentMenu, SelectedItem)
spawnCar("sum2")
end
local Item3 = NativeUI.CreateItem("Charger", "Spawn SWAT Charger")
Item3.Activated = function(ParentMenu, SelectedItem)
spawnCar("sum1")
end
submenu:AddItem(Item)
submenu:AddItem(Item2)
submenu:AddItem(Item3)
end
end
sheriffMenu(mainMenu)
fireMenu(mainMenu)
swatMenu(mainMenu)
_menuPool:RefreshIndex()
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
Policeped = PlayerPedId()
_menuPool:ProcessMenus()
if vehMenu == true then
mainMenu:Visible(not mainMenu:Visible())
vehMenu = false
end
end
end)
-- End Vehicles Menu
-- Start LEO Menu
leoMenu = NativeUI.CreateMenu("LEO Toolbox", "~b~CRONUS GAMING LEO UTILITIES MENU")
_menuPool:Add(leoMenu)
leostuff = false
function cuffOption(menu)
local Item = NativeUI.CreateItem("Cuff", "Cuff the person closest to you")
menu.OnItemSelect = function(sender, item, index)
cuffPlayer()
end
menu:AddItem(Item)
end
function uncuffOption(menu)
local Item = NativeUI.CreateItem("Uncuff", "Uncuff the person closest to you")
menu.OnItemSelect = function(sender, item, index)
uncuffPlayer()
end
menu:AddItem(Item)
end
function dragOption(menu)
local Item = NativeUI.CreateItem("Drag", "Drag the person closest to you")
menu.OnItemSelect = function(sender, item, index)
dragPlayer()
end
menu:AddItem(Item)
end
function undragOption(menu)
local Item = NativeUI.CreateItem("Undrag", "Undrag the person closest to you")
menu.OnItemSelect = function(sender, item, index)
undragPlayer()
end
menu:AddItem(Item)
end
function evehOption(menu)
local Item = NativeUI.CreateItem("Make Player Enter Vehicle", "Make the person closest to you enter the vehicle closest to you")
menu.OnItemSelect = function(sender, item, index)
evehiclePlayer()
end
menu:AddItem(Item)
end
function lvehOption(menu)
local Item = NativeUI.CreateItem("Make Player Exit Vehicle", "Make the person closest to you exit the vehicle closest to you")
menu.OnItemSelect = function(sender, item, index)
lvehiclePlayer()
end
menu:AddItem(Item)
end
function entityOption(menu)
local submenu = _menuPool:AddSubMenu(menu, "Spawn Objects")
for i = 1, 1 do
local Item = NativeUI.CreateItem("Steel Barrier", "Spawn Steel Barrier")
Item.Activated = function(ParentMenu, SelectedItem)
spawnEntity("prop_barrier_work04a")
end
local Item2 = NativeUI.CreateItem("Wood Barrier", "Spawn Wood Barrier")
Item2.Activated = function(ParentMenu, SelectedItem)
spawnEntity("prop_barrier_work05")
end
local Item4 = NativeUI.CreateItem("Road Work LED", "Spawn Road Work LED Sign")
Item4.Activated = function(ParentMenu, SelectedItem)
spawnEntity("prop_trafficdiv_01")
end
submenu:AddItem(Item)
submenu:AddItem(Item2)
submenu:AddItem(Item3)
submenu:AddItem(Item4)
end
end
function despawnOption(menu)
local amount = {}
for i = 1, 100 do amount[i] = i end
local Item = NativeUI.CreateSliderItem("Despawn Objects", amount, 5, "Despawn all objects within a radius", false)
menu.OnItemSelect = function(sender, item, index)
rad = item:IndexToItem(index)
despawnProp(rad)
end
menu:AddItem(Item)
end
cuffOption(leoMenu)
uncuffOption(leoMenu)
dragOption(leoMenu)
undragOption(leoMenu)
evehOption(leoMenu)
lvehOption(leoMenu)
despawnOption(leoMenu)
_menuPool:RefreshIndex()
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
_menuPool:ProcessMenus()
if IsControlJustPressed(1, 166) and leostuff == true then
leoMenu:Visible(not leoMenu:Visible())
leostuff = false
end
end
end)
-- Make Sure Player is in Correct PED for F5 menu
local skins = {
"s_m_y_cop_01",
"s_f_y_cop_01",
"s_m_y_hwaycop_01",
"s_m_y_sheriff_01",
"s_f_y_sheriff_01",
"s_m_y_ranger_01",
"s_f_y_ranger_01",
"csb_mweather",
"s_m_m_armoured_01",
"s_m_m_armoured_02",
"s_m_y_blackops_02",
"s_m_y_fireman_01",
"s_m_y_grip_01",
"s_m_y_marine_01",
"s_m_y_marine_02",
"s_m_y_marine_03",
"s_m_y_ranger_01",
"s_m_y_swat_01",
}
function CheckSkin(ped)
for i = 1, #skins do
if GetHashKey(skins[i]) == GetEntityModel(PlayerId()) then
leostuff = true
end
end
end