diff --git a/qbx_afk/server.lua b/qbx_afk/server.lua index 96e7544..7ee4b15 100644 --- a/qbx_afk/server.lua +++ b/qbx_afk/server.lua @@ -42,6 +42,7 @@ AddEventHandler('QBCore:Server:OnPermissionUpdate', function(source) updateCheckUser(source) end) +---@TODO determine if lib.cron is better for this CreateThread(function() for _, v in pairs(GetPlayers()) do v = tonumber(v) diff --git a/qbx_consumables/client.lua b/qbx_consumables/client.lua index ccee141..81d8d74 100644 --- a/qbx_consumables/client.lua +++ b/qbx_consumables/client.lua @@ -29,6 +29,7 @@ local function trevorEffect() AnimpostfxStop('DrugsTrevorClownsFightIn') AnimpostfxStop('DrugsTrevorClownsFightOut') end +exports('TrevorEffect', trevorEffect) local function methBagEffect() local startStamina = 8 @@ -46,6 +47,7 @@ local function methBagEffect() end SetRunSprintMultiplierForPlayer(cache.playerId, 1.0) end +exports('MethBagEffect', methBagEffect) local function ecstasyEffect() local startStamina = 30 @@ -63,6 +65,7 @@ local function ecstasyEffect() SetPedToRagdoll(cache.ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) end end +exports('EcstasyEffect', ecstasyEffect) local function alienEffect() AnimpostfxPlay('DrugsMichaelAliensFightIn', 3.0, false) @@ -74,6 +77,7 @@ local function alienEffect() AnimpostfxStop('DrugsMichaelAliensFight') AnimpostfxStop('DrugsMichaelAliensFightOut') end +exports('AlienEffect', alienEffect) local function crackBaggyEffect() local startStamina = 8 @@ -97,6 +101,7 @@ local function crackBaggyEffect() end SetRunSprintMultiplierForPlayer(cache.playerId, 1.0) end +exports('CrackBaggyEffect', crackBaggyEffect) local function cokeBaggyEffect() local startStamina = 20 @@ -121,6 +126,7 @@ local function cokeBaggyEffect() end SetRunSprintMultiplierForPlayer(cache.playerId, 1.0) end +exports('CokeBaggyEffect', cokeBaggyEffect) local function smokeWeed() CreateThread(function() @@ -408,6 +414,7 @@ RegisterNetEvent('consumables:client:UseJoint', function() end end) +--@TODO Rework this to only run when needed. CreateThread(function() while true do Wait(10) diff --git a/qbx_consumables/server.lua b/qbx_consumables/server.lua index 83c62e8..e8d3a00 100644 --- a/qbx_consumables/server.lua +++ b/qbx_consumables/server.lua @@ -191,7 +191,16 @@ RegisterNetEvent('consumables:server:addThirst', function(amount) end end) +---@deprecated use SetHunger instead exports('setHunger', setHunger) +---@deprecated use AddHunger instead exports('addHunger', addHunger) +---@deprecated use SetThirst instead exports('setThirst', setThirst) +---@deprecated use AddThirst instead exports('addThirst', addThirst) + +exports('SetHunger', setHunger) +exports('AddHunger', addHunger) +exports('SetThirst', setThirst) +exports('AddThirst', addThirst) diff --git a/qbx_disableservices/config.json b/qbx_disableservices/config.json index e2fc430..92115f2 100644 --- a/qbx_disableservices/config.json +++ b/qbx_disableservices/config.json @@ -1,4 +1,5 @@ { + // Add documentation for each variable here "enabledServices": [ false, false, diff --git a/qbx_flipvehicle/client.lua b/qbx_flipvehicle/client.lua index 8c08b67..9876c24 100644 --- a/qbx_flipvehicle/client.lua +++ b/qbx_flipvehicle/client.lua @@ -36,5 +36,7 @@ local function flipVehicle(vehicle, flipTest) end end +---@deprecated use FlipVehicle instead exports('flipVehicle', flipVehicle) + exports('FlipVehicle', flipVehicle) diff --git a/qbx_hudcomponents/client.lua b/qbx_hudcomponents/client.lua index 0d5d5c3..ba88d12 100644 --- a/qbx_hudcomponents/client.lua +++ b/qbx_hudcomponents/client.lua @@ -5,7 +5,7 @@ local displayAmmo = config.disable.displayAmmo CreateThread(function() while true do - + for i = 1, #disableHudComponents do HideHudComponentThisFrame(disableHudComponents[i]) end @@ -30,7 +30,9 @@ local function addDisableHudComponents(hudComponents) end end +---@deprecated use AddDisableHudComponents instead exports('addDisableHudComponents', addDisableHudComponents) +exports('AddDisableHudComponents', addDisableHudComponents) local function removeDisableHudComponents(hudComponents) local hudComponentsType = type(hudComponents) @@ -52,13 +54,17 @@ local function removeDisableHudComponents(hudComponents) end end +---@deprecated use RemoveDisableHudComponents instead exports('removeDisableHudComponents', removeDisableHudComponents) +exports('RemoveDisableHudComponents', removeDisableHudComponents) local function getDisableHudComponents() return disableHudComponents end +---@deprecated use GetDisableHudComponents instead exports('getDisableHudComponents', getDisableHudComponents) +exports('GetDisableHudComponents', getDisableHudComponents) local function addDisableControls(controls) local controlsType = type(controls) @@ -71,7 +77,9 @@ local function addDisableControls(controls) end end +---@deprecated use AddDisableControls instead exports('addDisableControls', addDisableControls) +exports('AddDisableControls', addDisableControls) local function removeDisableControls(controls) local controlsType = type(controls) @@ -93,22 +101,30 @@ local function removeDisableControls(controls) end end +---@deprecated use RemoveDisableControls instead exports('removeDisableControls', removeDisableControls) +exports('RemoveDisableControls', removeDisableControls) local function getDisableControls() return disableControls end +---@deprecated use GetDisableControls instead exports('getDisableControls', getDisableControls) +exports('GetDisableControls', getDisableControls) local function setDisplayAmmo(bool) displayAmmo = bool end +---@deprecated use SetDisplayAmmo instead exports('setDisplayAmmo', setDisplayAmmo) +exports('SetDisplayAmmo', setDisplayAmmo) local function getDisplayAmmo() return displayAmmo end +---@deprecated use GetDisplayAmmo instead exports('getDisplayAmmo', getDisplayAmmo) +exports('GetDisplayAmmo', getDisplayAmmo) diff --git a/qbx_ignore/client.lua b/qbx_ignore/client.lua index 508759e..04f3a4c 100644 --- a/qbx_ignore/client.lua +++ b/qbx_ignore/client.lua @@ -1,5 +1,6 @@ local config = require 'qbx_ignore.config' +---@TODO test if this needs to be called in a loop CreateThread(function() while true do for _, sctyp in next, config.blacklisted.scenarioTypes do @@ -42,27 +43,15 @@ CreateThread(function() -- all these should only need to be called once RemoveVehiclesFromGeneratorsInArea(-724.46 - 300.0, -1444.03 - 300.0, 5.0 - 300.0, -724.46 + 300.0, -1444.03 + 300.0, 5.0 + 300.0) -- REMOVE CHOPPERS WOW end) -CreateThread(function() - while true do - if IsPedBeingStunned(cache.ped, 0) then - SetPedMinGroundTimeForStungun(cache.ped, math.random(4000, 7000)) - Wait(0) - else - Wait(1000) - end - end -end) - if config.disable.idleCamera then DisableIdleCamera(true) end -CreateThread(function() - local sleep - while true do - sleep = 500 - local weapon = GetSelectedPedWeapon(cache.ped) - if weapon ~= `WEAPON_UNARMED` then +local function pistolWhipLoop() + CreateThread(function() + local sleep + while cache.weapon do + sleep = 500 if IsPedArmed(cache.ped, 6) then sleep = 0 DisableControlAction(1, 140, true) @@ -70,13 +59,19 @@ CreateThread(function() DisableControlAction(1, 142, true) end - if weapon == `WEAPON_FIREEXTINGUISHER` or weapon == `WEAPON_PETROLCAN` then + if cache.weapon == `WEAPON_FIREEXTINGUISHER` or cache.weapon == `WEAPON_PETROLCAN` then if IsPedShooting(cache.ped) then SetPedInfiniteAmmo(cache.ped, true, `WEAPON_FIREEXTINGUISHER`) SetPedInfiniteAmmo(cache.ped, true, `WEAPON_PETROLCAN`) end end + Wait(sleep) end - Wait(sleep) - end -end) + end) +end + +lib.onCache('weapon', function(weapon) + Wait(5) + if not weapon then return end + pistolWhipLoop() +end) \ No newline at end of file diff --git a/qbx_recoils/client.lua b/qbx_recoils/client.lua index 8eb142b..d393d9c 100644 --- a/qbx_recoils/client.lua +++ b/qbx_recoils/client.lua @@ -1,34 +1,42 @@ local recoils = require 'qbx_recoils.config' -CreateThread(function() - while true do - if IsPedShooting(cache.ped) and not IsPedDoingDriveby(cache.ped) then - local _, wep = GetCurrentPedWeapon(cache.ped, true) - if recoils[wep] and recoils[wep] ~= 0 then - -- luacheck: ignore - local tv = 0 - if GetFollowPedCamViewMode() ~= 4 then - repeat - Wait(0) - local p = GetGameplayCamRelativePitch() - SetGameplayCamRelativePitch(p + 0.1, 0.2) - tv += 0.1 - until tv >= recoils[wep] - else - repeat - Wait(0) - local p = GetGameplayCamRelativePitch() - if recoils[wep] > 0.1 then - SetGameplayCamRelativePitch(p + 0.6, 1.2) - tv += 0.6 - else - SetGameplayCamRelativePitch(p + 0.016, 0.333) +local function recoilLoop() + CreateThread(function() + while cache.weapon do + if IsPedShooting(cache.ped) and not IsPedDoingDriveby(cache.ped) then + local _, wep = GetCurrentPedWeapon(cache.ped, true) + if recoils[wep] and recoils[wep] ~= 0 then + -- luacheck: ignore + local tv = 0 + if GetFollowPedCamViewMode() ~= 4 then + repeat + Wait(0) + local p = GetGameplayCamRelativePitch() + SetGameplayCamRelativePitch(p + 0.1, 0.2) tv += 0.1 - end - until tv >= recoils[wep] + until tv >= recoils[wep] + else + repeat + Wait(0) + local p = GetGameplayCamRelativePitch() + if recoils[wep] > 0.1 then + SetGameplayCamRelativePitch(p + 0.6, 1.2) + tv += 0.6 + else + SetGameplayCamRelativePitch(p + 0.016, 0.333) + tv += 0.1 + end + until tv >= recoils[wep] + end end end + Wait(350) -- might be able to reduce time here for more recoil end - Wait(350) - end -end) + end) +end + +lib.onCache('weapon', function(weapon) + Wait(5) + if not weapon then return end + recoilLoop() +end) \ No newline at end of file