Skip to content

Commit

Permalink
fix: qbx_medical exports to PascalCase and self exports too
Browse files Browse the repository at this point in the history
* Updated qbx_medical exports to PascalCase and ensured qbx_ambulancejobs are also in PascalCase

* Removed unused variable

* Added dependencies to fxmanifest - qbx_core/medical, ox_lib/inventory
  • Loading branch information
JHansen2000 authored Jun 2, 2024
1 parent f04253e commit cfd4ada
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/hospital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ local function putPlayerInBed(hospitalName, bedIndex, isRevive, skipOpenCheck)
bedOccupyingData = sharedConfig.locations.hospitals[hospitalName].beds[bedIndex]
IsInHospitalBed = true
exports.qbx_medical:DisableDamageEffects()
exports.qbx_medical:disableRespawn()
exports.qbx_medical:DisableRespawn()
CanLeaveBed = false
setBedCam()
CreateThread(function()
Expand Down
1 change: 0 additions & 1 deletion client/job.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local config = require 'config.client'
local sharedConfig = require 'config.shared'
local checkVehicle = false
local WEAPONS = exports.qbx_core:GetWeapons()

---Configures and spawns a vehicle and teleports player to the driver seat.
Expand Down
2 changes: 1 addition & 1 deletion client/laststand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lib.callback.register('hospital:client:UseFirstAid', function()
end)

lib.callback.register('hospital:client:canHelp', function()
return exports.qbx_medical:getLaststand() and exports.qbx_medical:getLaststandTime() <= 300
return exports.qbx_medical:GetLaststand() and exports.qbx_medical:GetLaststandTime() <= 300
end)

---@param targetId number playerId
Expand Down
12 changes: 6 additions & 6 deletions client/setdownedstate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ local function getDoctorCount()
end

local function displayRespawnText()
local deathTime = exports.qbx_medical:getDeathTime()
local deathTime = exports.qbx_medical:GetDeathTime()
if deathTime > 0 and doctorCount > 0 then
qbx.drawText2d({ text = locale('info.respawn_txt', math.ceil(deathTime)), coords = vec2(1.0, 1.44), scale = 0.6 })
else
qbx.drawText2d({
text = locale('info.respawn_revive', exports.qbx_medical:getRespawnHoldTimeDeprecated(), sharedConfig.checkInCost),
text = locale('info.respawn_revive', exports.qbx_medical:GetRespawnHoldTimeDeprecated(), sharedConfig.checkInCost),
coords = vec2(1.0, 1.44),
scale = 0.6
})
Expand All @@ -27,7 +27,7 @@ local function playDeadAnimation(ped)
TaskPlayAnim(ped, InBedDict, InBedAnim, 1.0, 1.0, -1, 1, 0, false, false, false)
end
else
exports.qbx_medical:playDeadAnimation()
exports.qbx_medical:PlayDeadAnimation()
end
end

Expand All @@ -54,7 +54,7 @@ local function handleRequestingEms()
end

local function handleLastStand()
local laststandTime = exports.qbx_medical:getLaststandTime()
local laststandTime = exports.qbx_medical:GetLaststandTime()
if laststandTime > config.laststandTimer or doctorCount == 0 then
qbx.drawText2d({ text = locale('info.bleed_out', math.ceil(laststandTime)), coords = vec2(1.0, 1.44), scale = 0.6 })
else
Expand All @@ -66,8 +66,8 @@ end
---Set dead and last stand states.
CreateThread(function()
while true do
local isDead = exports.qbx_medical:isDead()
local inLaststand = exports.qbx_medical:getLaststand()
local isDead = exports.qbx_medical:IsDead()
local inLaststand = exports.qbx_medical:GetLaststand()
if isDead or inLaststand then
if isDead then
handleDead(cache.ped)
Expand Down
6 changes: 3 additions & 3 deletions client/wounding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lib.callback.register('hospital:client:UseIfaks', function()
painkillerAmount += 1
end
if math.random(1, 100) < 50 then
exports.qbx_medical:removeBleed(1)
exports.qbx_medical:RemoveBleed(1)
end
return true
else
Expand Down Expand Up @@ -58,10 +58,10 @@ lib.callback.register('hospital:client:UseBandage', function()
then
SetEntityHealth(cache.ped, GetEntityHealth(cache.ped) + 10)
if math.random(1, 100) < 50 then
exports.qbx_medical:removeBleed(1)
exports.qbx_medical:RemoveBleed(1)
end
if math.random(1, 100) < 7 then
exports.qbx_medical:resetMinorInjuries()
exports.qbx_medical:ResetMinorInjuries()
end
return true
else
Expand Down
7 changes: 7 additions & 0 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ version '1.0.0'

ox_lib 'locale'

dependencies {
'qbx_core',
'qbx_medical',
'ox_lib',
'ox_inventory'
}

shared_scripts {
'@ox_lib/init.lua',
'@qbx_core/modules/lib.lua',
Expand Down

0 comments on commit cfd4ada

Please sign in to comment.