From c1209e69f18b9e3b3cf3f41dfe3270ccdd78b16e Mon Sep 17 00:00:00 2001 From: Manason Date: Wed, 27 Sep 2023 19:55:06 -0700 Subject: [PATCH] fix: use exports (#42) * fix: use exports * fix: lint error --- client/carwash.lua | 4 +-- client/consumables.lua | 46 ++++++++++++------------ client/cruise.lua | 8 ++--- client/fireworks.lua | 4 +-- client/seatbelt.lua | 2 +- client/suicide.lua | 4 +-- client/vehicletext.lua | 2 +- fxmanifest.lua | 1 - server/afk.lua | 6 ++-- server/consumables.lua | 80 +++++++++++++++++++++--------------------- server/logs.lua | 2 +- server/main.lua | 8 ++--- 12 files changed, 83 insertions(+), 84 deletions(-) diff --git a/client/carwash.lua b/client/carwash.lua index d66eec4..d682a5f 100644 --- a/client/carwash.lua +++ b/client/carwash.lua @@ -19,7 +19,7 @@ RegisterNetEvent('qb-carwash:client:washCar', function() WashDecalsFromVehicle(cache.vehicle, 1.0) washingVehicle = false else -- if cancel - QBX.Functions.Notify('Washing canceled...', 'error') + exports.qbx_core:Notify('Washing canceled...', 'error') washingVehicle = false end end) @@ -42,7 +42,7 @@ CreateThread(function() if dirtLevel > Config.CarWash.dirtLevel then TriggerServerEvent('qb-carwash:server:washCar') else - QBX.Functions.Notify('The vehicle isn\'t dirty', 'error') + exports.qbx_core:Notify('The vehicle isn\'t dirty', 'error') end end else diff --git a/client/consumables.lua b/client/consumables.lua index 29133a1..35ea4a8 100644 --- a/client/consumables.lua +++ b/client/consumables.lua @@ -161,7 +161,7 @@ RegisterNetEvent('consumables:client:Eat', function(itemName) combat = true } }) then -- if completed - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items[itemName], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()[itemName], 'remove') exports.scully_emotemenu:cancelEmote() TriggerServerEvent('consumables:server:addHunger', QBX.PlayerData.metadata.hunger + ConsumablesEat[itemName]) TriggerServerEvent('hud:server:RelieveStress', math.random(2, 4)) @@ -182,7 +182,7 @@ RegisterNetEvent('consumables:client:Drink', function(itemName) combat = true } }) then -- if completed - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items[itemName], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()[itemName], 'remove') exports.scully_emotemenu:cancelEmote() TriggerServerEvent('consumables:server:addThirst', QBX.PlayerData.metadata.thirst + ConsumablesDrink[itemName]) end @@ -203,7 +203,7 @@ RegisterNetEvent('consumables:client:DrinkAlcohol', function(itemName) } }) then -- if completed exports.scully_emotemenu:cancelEmote() - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items[itemName], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()[itemName], 'remove') TriggerServerEvent('consumables:server:drinkAlcohol', itemName) TriggerServerEvent('consumables:server:addThirst', QBX.PlayerData.metadata.thirst + ConsumablesAlcohol[itemName]) TriggerServerEvent('hud:server:RelieveStress', math.random(2, 4)) @@ -215,7 +215,7 @@ RegisterNetEvent('consumables:client:DrinkAlcohol', function(itemName) end else -- if canceled exports.scully_emotemenu:cancelEmote() - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) @@ -238,11 +238,11 @@ RegisterNetEvent('consumables:client:Cokebaggy', function() } }) then -- if completed TriggerServerEvent('consumables:server:useCokeBaggy') - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['cokebaggy'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['cokebaggy'], 'remove') TriggerEvent('evidence:client:SetStatus', 'widepupils', 200) cokeBaggyEffect() else -- if canceled - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) @@ -265,11 +265,11 @@ RegisterNetEvent('consumables:client:Crackbaggy', function() } }) then -- if completed TriggerServerEvent('consumables:server:useCrackBaggy') - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['crack_baggy'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['crack_baggy'], 'remove') TriggerEvent('evidence:client:SetStatus', 'widepupils', 300) crackBaggyEffect() else -- if canceled - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) @@ -292,10 +292,10 @@ RegisterNetEvent('consumables:client:EcstasyBaggy', function() } }) then -- if completed TriggerServerEvent('consumables:server:useXTCBaggy') - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items.xtcbaggy, 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items().xtcbaggy, 'remove') ecstasyEffect() else -- if canceled - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) @@ -318,11 +318,11 @@ RegisterNetEvent('consumables:client:oxy', function() } }) then -- if completed TriggerServerEvent('consumables:server:useOxy') - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['oxy'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['oxy'], 'remove') ClearPedBloodDamage(cache.ped) healOxy() else -- if canceled - QBX.Functions.Notify('Canceled', 'error') + exports.qbx_core:Notify('Canceled', 'error') end end) @@ -345,12 +345,12 @@ RegisterNetEvent('consumables:client:meth', function() } }) then -- if completed TriggerServerEvent('consumables:server:useMeth') - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['meth'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['meth'], 'remove') TriggerEvent('evidence:client:SetStatus', 'widepupils', 300) TriggerEvent('evidence:client:SetStatus', 'agitated', 300) methBagEffect() else -- if canceled - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) @@ -367,7 +367,7 @@ RegisterNetEvent('consumables:client:UseJoint', function() combat = true } }) then -- if completed - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['joint'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['joint'], 'remove') exports.scully_emotemenu:playEmoteByCommand('joint') TriggerEvent('evidence:client:SetStatus', 'weedsmell', 300) smokeWeed() @@ -388,7 +388,7 @@ RegisterNetEvent('consumables:client:UseParachute', function() combat = true } }) then -- if completed - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['parachute'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['parachute'], 'remove') GiveWeaponToPed(cache.ped, `GADGET_PARACHUTE`, 1, false, false) local parachuteData = { outfitData = {['bag'] = {item = 7, texture = 0}} -- Adding Parachute Clothing @@ -423,12 +423,12 @@ RegisterNetEvent('consumables:client:ResetParachute', function() parachuteEquipped = false end else - QBX.Functions.Notify('You don\'t have a parachute...', 'error') + exports.qbx_core:Notify('You don\'t have a parachute...', 'error') end end) RegisterNetEvent('consumables:client:UseArmor', function() - if GetPedArmour(cache.ped) >= 75 then QBX.Functions.Notify('You already have enough armor on!', 'error') return end + if GetPedArmour(cache.ped) >= 75 then exports.qbx_core:Notify('You already have enough armor on!', 'error') return end if lib.progressBar({ duration = 5000, label = 'Putting on the body armour...', @@ -441,7 +441,7 @@ RegisterNetEvent('consumables:client:UseArmor', function() combat = true } }) then -- if completed - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['armor'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['armor'], 'remove') TriggerServerEvent('hospital:server:SetArmor', 75) TriggerServerEvent('consumables:server:useArmor') SetPedArmour(cache.ped, 75) @@ -449,7 +449,7 @@ RegisterNetEvent('consumables:client:UseArmor', function() end) RegisterNetEvent('consumables:client:UseHeavyArmor', function() - if GetPedArmour(cache.ped) == 100 then QBX.Functions.Notify('You already have enough armor on!', 'error') return end + if GetPedArmour(cache.ped) == 100 then exports.qbx_core:Notify('You already have enough armor on!', 'error') return end if lib.progressBar({ duration = 5000, label = 'Putting on body armor...', @@ -475,7 +475,7 @@ RegisterNetEvent('consumables:client:UseHeavyArmor', function() currentVestTexture = GetPedTextureVariation(cache.ped, 30) SetPedComponentVariation(cache.ped, 9, 30, 0, 2) end - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['heavyarmor'], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['heavyarmor'], 'remove') TriggerServerEvent('consumables:server:useHeavyArmor') SetPedArmour(cache.ped, 100) end @@ -497,11 +497,11 @@ RegisterNetEvent('consumables:client:ResetArmor', function() }) then -- if completed SetPedComponentVariation(cache.ped, 9, currentVest, currentVestTexture, 2) SetPedArmour(cache.ped, 0) - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items['heavyarmor'], 'add') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()['heavyarmor'], 'add') TriggerServerEvent('consumables:server:resetArmor') end else - QBX.Functions.Notify('You\'re not wearing a vest...', 'error') + exports.qbx_core:Notify('You\'re not wearing a vest...', 'error') end end) diff --git a/client/cruise.lua b/client/cruise.lua index 2d7c487..c8c6300 100644 --- a/client/cruise.lua +++ b/client/cruise.lua @@ -31,7 +31,7 @@ local function TriggerCruiseControl() if cruisedSpeed > 0 and GetVehicleCurrentGear(cache.vehicle) > 0 then TriggerEvent('seatbelt:client:ToggleCruise') - QBX.Functions.Notify('Cruise control enabled!', 'success') + exports.qbx_core:Notify('Cruise control enabled!', 'success') CreateThread(function() while cruisedSpeed > 0 and cache.vehicle do @@ -42,7 +42,7 @@ local function TriggerCruiseControl() if not turningOrBraking and speed < (cruisedSpeed - 1.5) then cruisedSpeed = 0 TriggerEvent('seatbelt:client:ToggleCruise') - QBX.Functions.Notify('Cruise control disabled!', 'error') + exports.qbx_core:Notify('Cruise control disabled!', 'error') Wait(500) break end @@ -59,7 +59,7 @@ local function TriggerCruiseControl() if IsControlJustPressed(2, 72) then cruisedSpeed = 0 TriggerEvent('seatbelt:client:ToggleCruise') - QBX.Functions.Notify('Cruise control disabled!', 'error') + exports.qbx_core:Notify('Cruise control disabled!', 'error') Wait(500) break end @@ -76,7 +76,7 @@ RegisterCommand('togglecruise', function() if vehicleClasses[vehicleClass] then TriggerCruiseControl() else - QBX.Functions.Notify('Cruise control unavailable', 'error') + exports.qbx_core:Notify('Cruise control unavailable', 'error') end end end, false) diff --git a/client/fireworks.lua b/client/fireworks.lua index 1a0ad02..49a2cdf 100644 --- a/client/fireworks.lua +++ b/client/fireworks.lua @@ -92,10 +92,10 @@ RegisterNetEvent('fireworks:client:UseFirework', function(itemName, assetName) }, }) then TriggerServerEvent('consumables:server:UseFirework', itemName) - TriggerEvent('inventory:client:ItemBox', QBX.Shared.Items[itemName], 'remove') + TriggerEvent('inventory:client:ItemBox', exports.ox_inventory:Items()[itemName], 'remove') local pos = GetEntityCoords(cache.ped) doFirework(assetName, pos) else - QBX.Functions.Notify('Canceled...', 'error') + exports.qbx_core:Notify('Canceled...', 'error') end end) diff --git a/client/seatbelt.lua b/client/seatbelt.lua index 56ae1f8..5ae382a 100644 --- a/client/seatbelt.lua +++ b/client/seatbelt.lua @@ -229,7 +229,7 @@ end) RegisterNetEvent('seatbelt:client:UseHarness', function(ItemData) local class = GetVehicleClass(cache.vehicle) if not cache.vehicle or class == 8 or class == 13 or class == 14 then - QBX.Functions.Notify('You\'re not in a car.', 'error') + exports.qbx_core:Notify('You\'re not in a car.', 'error') return end if not harnessOn then diff --git a/client/suicide.lua b/client/suicide.lua index 7fa2fe2..f8d9cdc 100644 --- a/client/suicide.lua +++ b/client/suicide.lua @@ -29,8 +29,8 @@ RegisterCommand('suicide', function() Wait(750) SetPedShootsAtCoord(cache.ped, 0.0, 0.0, 0.0, 0) SetEntityHealth(cache.ped, 0) - QBX.Functions.Notify('You killed yourself', 'error') + exports.qbx_core:Notify('You killed yourself', 'error') else - QBX.Functions.Notify('You don\'t have a pistol with ammo in your hand', 'error') + exports.qbx_core:Notify('You don\'t have a pistol with ammo in your hand', 'error') end end, false) \ No newline at end of file diff --git a/client/vehicletext.lua b/client/vehicletext.lua index 150f4af..d45716d 100644 --- a/client/vehicletext.lua +++ b/client/vehicletext.lua @@ -1,5 +1,5 @@ CreateThread(function() - for _, v in pairs(QBX.Shared.Vehicles) do + for _, v in pairs(exports.qbx_core:GetVehiclesByName()) do local text if v.brand then text = v.brand .. ' ' .. v.name diff --git a/fxmanifest.lua b/fxmanifest.lua index 5f072f5..143b81a 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -24,7 +24,6 @@ files { } modules { - 'qbx_core:core', 'qbx_core:playerdata', 'qbx_core:utils' } diff --git a/server/afk.lua b/server/afk.lua index 8bdb08e..56ff209 100644 --- a/server/afk.lua +++ b/server/afk.lua @@ -14,7 +14,7 @@ local timeMinutes = { } local function updateCheckUser(source) - local permissions = QBX.Functions.GetPermission(source) + local permissions = exports.qbx_core:GetPermission(source) for k in pairs(permissions) do if Config.IgnoreGroupsForAFK[k] then @@ -66,9 +66,9 @@ CreateThread(function() if time[v] > 0 then local _type = timeMinutes[time[v]] if _type == 'minutes' then - QBX.Functions.Notify(v, 'You are AFK and will be kicked in ' .. math.ceil(time[v] / 60) .. ' minute(s)!', 'error', 10000) + exports.qbx_core:Notify(v, 'You are AFK and will be kicked in ' .. math.ceil(time[v] / 60) .. ' minute(s)!', 'error', 10000) elseif _type == 'seconds' then - QBX.Functions.Notify(v, 'You are AFK and will be kicked in ' .. time[v] .. ' seconds!', 'error', 10000) + exports.qbx_core:Notify(v, 'You are AFK and will be kicked in ' .. time[v] .. ' seconds!', 'error', 10000) end time[v] -= 1 else diff --git a/server/consumables.lua b/server/consumables.lua index 3d1fa9b..fc7a1c8 100644 --- a/server/consumables.lua +++ b/server/consumables.lua @@ -1,8 +1,8 @@ ----------- / alcohol for cAl in pairs(ConsumablesAlcohol) do - QBX.Functions.CreateUseableItem(cAl, function(source, item) + exports.qbx_core:CreateUseableItem(cAl, function(source, item) local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) if player.Functions.RemoveItem(item.name, 1, item.slot) then TriggerClientEvent('consumables:client:DrinkAlcohol', src, item.name) end @@ -11,9 +11,9 @@ end ----------- / Non-Alcoholic Drinks for cDr in pairs(ConsumablesDrink) do - QBX.Functions.CreateUseableItem(cDr, function(source, item) + exports.qbx_core:CreateUseableItem(cDr, function(source, item) local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) if player.Functions.RemoveItem(item.name, 1, item.slot) then TriggerClientEvent('consumables:client:Drink', src, item.name) end @@ -22,9 +22,9 @@ end ----------- / Food for cEa in pairs(ConsumablesEat) do - QBX.Functions.CreateUseableItem(cEa, function(source, item) + exports.qbx_core:CreateUseableItem(cEa, function(source, item) local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) if player.Functions.RemoveItem(item.name, 1, item.slot) then TriggerClientEvent('consumables:client:Eat', src, item.name) end @@ -33,46 +33,46 @@ end ----------- / Drug -QBX.Functions.CreateUseableItem('joint', function(source, item) - local player = QBX.Functions.GetPlayer(source) +exports.qbx_core:CreateUseableItem('joint', function(source, item) + local player = exports.qbx_core:GetPlayer(source) if not player.Functions.RemoveItem(item.name, 1, item.slot) then return end TriggerClientEvent('consumables:client:UseJoint', source) end) -QBX.Functions.CreateUseableItem('cokebaggy', function(source) +exports.qbx_core:CreateUseableItem('cokebaggy', function(source) TriggerClientEvent('consumables:client:Cokebaggy', source) end) -QBX.Functions.CreateUseableItem('crack_baggy', function(source) +exports.qbx_core:CreateUseableItem('crack_baggy', function(source) TriggerClientEvent('consumables:client:Crackbaggy', source) end) -QBX.Functions.CreateUseableItem('xtcbaggy', function(source, _) +exports.qbx_core:CreateUseableItem('xtcbaggy', function(source, _) TriggerClientEvent('consumables:client:EcstasyBaggy', source) end) -QBX.Functions.CreateUseableItem('oxy', function(source) +exports.qbx_core:CreateUseableItem('oxy', function(source) TriggerClientEvent('consumables:client:oxy', source) end) -QBX.Functions.CreateUseableItem('meth', function(source) +exports.qbx_core:CreateUseableItem('meth', function(source) TriggerClientEvent('consumables:client:meth', source) end) ----------- / Tools -QBX.Functions.CreateUseableItem('armor', function(source) +exports.qbx_core:CreateUseableItem('armor', function(source) TriggerClientEvent('consumables:client:UseArmor', source) end) -QBX.Functions.CreateUseableItem('heavyarmor', function(source) +exports.qbx_core:CreateUseableItem('heavyarmor', function(source) TriggerClientEvent('consumables:client:UseHeavyArmor', source) end) lib.addCommand('resetvest', { help = 'Resets Vest (Police Only)', }, function(source) - local Player = QBX.Functions.GetPlayer(source) + local Player = exports.qbx_core:GetPlayer(source) if Player.PlayerData.job.name == 'police' then TriggerClientEvent('consumables:client:ResetArmor', source) else @@ -80,12 +80,12 @@ lib.addCommand('resetvest', { end end) -QBX.Functions.CreateUseableItem('binoculars', function(source) +exports.qbx_core:CreateUseableItem('binoculars', function(source) TriggerClientEvent('binoculars:Toggle', source) end) -QBX.Functions.CreateUseableItem('parachute', function(source, item) - local player = QBX.Functions.GetPlayer(source) +exports.qbx_core:CreateUseableItem('parachute', function(source, item) + local player = exports.qbx_core:GetPlayer(source) if not player.Functions.RemoveItem(item.name, 1, item.slot) then return end TriggerClientEvent('consumables:client:UseParachute', source) end) @@ -97,7 +97,7 @@ lib.addCommand('resetparachute', { end) RegisterNetEvent('qb-smallpenis:server:AddParachute', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -106,42 +106,42 @@ end) ----------- / Firework -QBX.Functions.CreateUseableItem('firework1', function(source, item) +exports.qbx_core:CreateUseableItem('firework1', function(source, item) local src = source TriggerClientEvent('fireworks:client:UseFirework', src, item.name, 'proj_indep_firework') end) -QBX.Functions.CreateUseableItem('firework2', function(source, item) +exports.qbx_core:CreateUseableItem('firework2', function(source, item) local src = source TriggerClientEvent('fireworks:client:UseFirework', src, item.name, 'proj_indep_firework_v2') end) -QBX.Functions.CreateUseableItem('firework3', function(source, item) +exports.qbx_core:CreateUseableItem('firework3', function(source, item) local src = source TriggerClientEvent('fireworks:client:UseFirework', src, item.name, 'proj_xmas_firework') end) -QBX.Functions.CreateUseableItem('firework4', function(source, item) +exports.qbx_core:CreateUseableItem('firework4', function(source, item) local src = source TriggerClientEvent('fireworks:client:UseFirework', src, item.name, 'scr_indep_fireworks') end) ----------- / Lockpicking -QBX.Functions.CreateUseableItem('lockpick', function(source) +exports.qbx_core:CreateUseableItem('lockpick', function(source) TriggerClientEvent('lockpicks:UseLockpick', source, false) TriggerEvent('lockpicks:UseLockpick', source, false) end) -QBX.Functions.CreateUseableItem('advancedlockpick', function(source) +exports.qbx_core:CreateUseableItem('advancedlockpick', function(source) TriggerClientEvent('lockpicks:UseLockpick', source, true) TriggerEvent('lockpicks:UseLockpick', source, true) end) ----------- / Unused --- QBX.Functions.CreateUseableItem('smoketrailred', function(source, item) --- local player = QBX.Functions.GetPlayer(source) +-- exports.qbx_core:CreateUseableItem('smoketrailred', function(source, item) +-- local player = exports.qbx_core:GetPlayer(source) -- if not player.Functions.RemoveItem(item.name, 1, item.slot) then return end -- TriggerClientEvent('consumables:client:UseRedSmoke', source) -- end) @@ -149,7 +149,7 @@ end) -- Events for adding and removing specific items to fix some exploits RegisterNetEvent('consumables:server:resetArmor', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -157,7 +157,7 @@ RegisterNetEvent('consumables:server:resetArmor', function() end) RegisterNetEvent('consumables:server:useHeavyArmor', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -165,7 +165,7 @@ RegisterNetEvent('consumables:server:useHeavyArmor', function() end) RegisterNetEvent('consumables:server:useArmor', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -173,7 +173,7 @@ RegisterNetEvent('consumables:server:useArmor', function() end) RegisterNetEvent('consumables:server:useMeth', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -181,7 +181,7 @@ RegisterNetEvent('consumables:server:useMeth', function() end) RegisterNetEvent('consumables:server:useOxy', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -189,7 +189,7 @@ RegisterNetEvent('consumables:server:useOxy', function() end) RegisterNetEvent('consumables:server:useXTCBaggy', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -197,7 +197,7 @@ RegisterNetEvent('consumables:server:useXTCBaggy', function() end) RegisterNetEvent('consumables:server:useCrackBaggy', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -205,7 +205,7 @@ RegisterNetEvent('consumables:server:useCrackBaggy', function() end) RegisterNetEvent('consumables:server:useCokeBaggy', function() - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -213,7 +213,7 @@ RegisterNetEvent('consumables:server:useCokeBaggy', function() end) RegisterNetEvent('consumables:server:drinkAlcohol', function(item) - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -232,7 +232,7 @@ RegisterNetEvent('consumables:server:drinkAlcohol', function(item) end) RegisterNetEvent('consumables:server:UseFirework', function(item) - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -251,7 +251,7 @@ RegisterNetEvent('consumables:server:UseFirework', function(item) end) RegisterNetEvent('consumables:server:addThirst', function(amount) - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end @@ -260,7 +260,7 @@ RegisterNetEvent('consumables:server:addThirst', function(amount) end) RegisterNetEvent('consumables:server:addHunger', function(amount) - local player = QBX.Functions.GetPlayer(source) + local player = exports.qbx_core:GetPlayer(source) if not player then return end diff --git a/server/logs.lua b/server/logs.lua index 4a4c832..f00f5cd 100644 --- a/server/logs.lua +++ b/server/logs.lua @@ -87,7 +87,7 @@ local allowedErr = { ---Log Queue ---@param payload Log Queue local function logPayload(payload) - PerformHttpRequest(payload.webhook, function(err, text, headers) + PerformHttpRequest(payload.webhook, function(err, _, headers) if err and not allowedErr[err] then print('^1Error occurred while attempting to send log to discord: ' .. err .. '^7') return diff --git a/server/main.lua b/server/main.lua index 8b0dc10..b72c3b7 100644 --- a/server/main.lua +++ b/server/main.lua @@ -8,13 +8,13 @@ lib.addCommand('id', { TriggerClientEvent('QBCore:Notify', source, 'ID: '..source) end) -QBX.Functions.CreateUseableItem('harness', function(source, item) +exports.qbx_core:CreateUseableItem('harness', function(source, item) TriggerClientEvent('seatbelt:client:UseHarness', source, item) end) RegisterNetEvent('equip:harness', function(item) local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) if not player then return end @@ -31,7 +31,7 @@ end) RegisterNetEvent('seatbelt:DoHarnessDamage', function(hp, data) local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) local harness = exports.ox_inventory:Search(src, 1, 'harness') @@ -47,7 +47,7 @@ end) RegisterNetEvent('qb-carwash:server:washCar', function() local src = source - local player = QBX.Functions.GetPlayer(src) + local player = exports.qbx_core:GetPlayer(src) if not player then return end