-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclient.lua
More file actions
237 lines (235 loc) · 10.5 KB
/
Copy pathclient.lua
File metadata and controls
237 lines (235 loc) · 10.5 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
Citizen.CreateThread(function()
local coords = Config.Location
if Config.Target == 'bt-target' then
exports['bt-target']:AddBoxZone("hackPC", vector3(coords.x, coords.y, coords.z), 1.5, 0.6, {
name="hackPC",
heading= coords.w,
debugPoly=false,
minZ= coords.z - 0.6,
maxZ= coords.z + 0.25
}, {
options = {
{
event = "hacks:menu",
icon = "fas fa-laptop",
label = "Hacker\'s Computer",
},
},
job = {"all"},
distance = 3.0
})
elseif Config.Target == 'qtarget' then
exports.qtarget:AddBoxZone("hackPC", vector3(coords.x, coords.y, coords.z), 1.5, 0.6, {
name="hackPC",
heading= coords.w,
debugPoly=false,
minZ= coords.z - 0.6,
maxZ= coords.z + 0.25
}, {
options = {
{
event = "hacks:menu",
icon = "fas fa-laptop",
label = "Hacker\'s Computer",
job = "all",
},
},
distance = 3.0
})
end
end)
AddEventHandler('hacks:menu', function()
HackMenu()
end)
function HackMenu()
local elements = {}
for k,v in pairs(Config.Hacks) do
if v.enabled == true then
if Config.ShowPrice then
table.insert(elements, {
label = k..' - $'..v.price,
value = k,
price = v.price
})
else
table.insert(elements, {
label = k,
value = k,
price = v.price
})
end
end
end
table.sort(elements, function(a, b)
return a.price < b.price
end)
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'hack_list',
{
title = 'Hacker\'s Computer',
align = 'top-left',
elements = elements
},
function(data, menu)
local option = data.current.value
if option == 'Lockpick' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
exports["lockpick"]:Lockpick(function(did_win)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Drilling' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
player = PlayerPedId()
FreezeEntityPosition(player, true)
SetCurrentPedWeapon(player, GetHashKey("WEAPON_UNARMED"),true)
Citizen.Wait(250)
local objHash = GetHashKey('hei_prop_heist_drill')
local anim = {dict = 'anim@heists@fleeca_bank@drilling', lib = 'drill_straight_idle'}
RequestAnimDict(anim.dict); while not HasAnimDictLoaded(anim.dict) do Citizen.Wait(1) end
RequestModel(objHash); while not HasModelLoaded(objHash) do Citizen.Wait(1) end
local coords = GetEntityCoords(player)
local heading = GetEntityHeading(player)
local object = CreateObject(objHash, coords.x, coords.y, coords.z + 0.2, true, true, true)
TaskPlayAnimAdvanced(player, anim.dict, anim.lib, coords.x, coords.y, coords.z, 0.0, 0.0, heading, 3.0, -4.0, -1, 2, 0, 0, 0 )
AttachEntityToEntity(object, player, GetPedBoneIndex(player, 28422), 0.0, 0, 0.0, 0.0, 0.0, 0.0, 1, 1, 0, 0, 2, 1)
SetEntityAsMissionEntity(object, true, true)
RequestAmbientAudioBank("DLC_HEIST_FLEECA_SOUNDSET", 0)
RequestAmbientAudioBank("DLC_MPHEIST\\HEIST_FLEECA_DRILL", 0)
RequestAmbientAudioBank("DLC_MPHEIST\\HEIST_FLEECA_DRILL_2", 0)
local soundID = GetSoundId()
Citizen.Wait(100)
PlaySoundFromEntity(soundID, "Drill", object, "DLC_HEIST_FLEECA_SOUNDSET", 1, 0)
Citizen.Wait(100)
local ptfx = {dict = 'core', name = 'ent_anim_pneumatic_drill'}
RequestNamedPtfxAsset(ptfx.dict); while not HasNamedPtfxAssetLoaded(ptfx.dict) do Citizen.Wait(1) end
SetPtfxAssetNextCall(ptfx.dict)
ptfx.effect = StartParticleFxLoopedOnEntity(ptfx.name, object, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.9, 0, 0, 0)
ShakeGameplayCam("ROAD_VIBRATION_SHAKE", 1.0)
Citizen.Wait(100)
TriggerEvent('Drilling:Start',function(status)
if status == 1 then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
ClearPedTasksImmediately(player)
StopSound(soundID)
ReleaseSoundId(soundID)
DeleteObject(object)
DeleteEntity(object)
FreezeEntityPosition(player, false)
StopParticleFxLooped(ptfx.effect, 0)
StopGameplayCamShaking(true)
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Voltlab' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent('ultra-voltlab', Config.Hacks[option].time, function(did_win)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Fallout' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent('fallouthacking:client:StartMinigame', Config.Hacks[option].wordLength, Config.Hacks[option].tries, function(did_win)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Hacking' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent("mhacking:show")
TriggerEvent("mhacking:start", Config.Hacks[option].length, Config.Hacks[option].duration, function(did_win)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
TriggerEvent('mhacking:hide')
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Fingerprint' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent("utk_fingerprint:Start", Config.Hacks[option].levels, Config.Hacks[option].tries, Config.Hacks[option].time, function(did_win, reason)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Thermite' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent('thermite:start',function(did_win)
if did_win then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end,0.3,1.0,0.5)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
elseif option == 'Keypad' then
menu.close()
ESX.TriggerServerCallback('hacks:fees', function (hasMoney)
if hasMoney then
TriggerEvent('ultra-keypadhack', Config.Hacks[option].tries, Config.Hacks[option].time, function(did_win)
if did_win == 1 then
ESX.ShowNotification('~g~Success!~s~')
else
ESX.ShowNotification('~r~Failed!~s~')
end
end)
else
ESX.ShowNotification('Not enough ~r~'..Config.Account..' Money~s!')
end
end, option)
end
end, function(data, menu)
menu.close()
end)
end