Skip to content

Commit

Permalink
fix: miscl fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason committed Jun 2, 2024
1 parent cfd4ada commit be3584f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/hospital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ local function checkIn(hospitalName)
}
})
then
lib.callback('qbx_ambulancejob:server:checkIn', false, nil, cache.serverId, hospitalName)
lib.callback.await('qbx_ambulancejob:server:checkIn', false, cache.serverId, hospitalName)
else
exports.qbx_core:Notify(locale('error.canceled'), 'error')
end
Expand Down
18 changes: 18 additions & 0 deletions client/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ if config.useTarget then
size = vec3(1.5, 1, 2),
rotation = 71,
debug = config.debugPoly,
canInteract = function()
return QBX.PlayerData.job.type == 'ems'
end,
options = {
{
icon = 'fa fa-clipboard',
Expand All @@ -310,6 +313,9 @@ if config.useTarget then
size = vec3(1, 1, 2),
rotation = -20,
debug = config.debugPoly,
canInteract = function()
return QBX.PlayerData.job.type == 'ems'
end,
options = {
{
icon = 'fa fa-clipboard',
Expand All @@ -332,6 +338,9 @@ if config.useTarget then
size = vec3(1, 1, 2),
rotation = -20,
debug = config.debugPoly,
canInteract = function()
return QBX.PlayerData.job.type == 'ems'
end,
options = {
{
icon = 'fa fa-clipboard',
Expand Down Expand Up @@ -390,13 +399,16 @@ else
rotation = -20,
debug = config.debugPoly,
onEnter = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
local label = QBX.PlayerData.job.onduty and locale('text.onduty_button') or locale('text.offduty_button')
lib.showTextUI(label)
end,
onExit = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
lib.hideTextUI()
end,
inside = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
OnKeyPress(toggleDuty)
end,
})
Expand All @@ -409,14 +421,17 @@ else
rotation = -20,
debug = config.debugPoly,
onEnter = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
if QBX.PlayerData.job.onduty then
lib.showTextUI(locale('text.pstash_button'))
end
end,
onExit = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
lib.hideTextUI()
end,
inside = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
OnKeyPress(function()
openStash(i)
end)
Expand All @@ -432,14 +447,17 @@ else
rotation = -20,
debug = config.debugPoly,
onEnter = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
if QBX.PlayerData.job.onduty then
lib.showTextUI(locale('text.armory_button'))
end
end,
onExit = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
lib.hideTextUI()
end,
inside = function()
if QBX.PlayerData.job.type ~= 'ems' then return end
OnKeyPress(function()
openArmory(i, ii)
end)
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:IsLaststand() and exports.qbx_medical:GetLaststandTime() <= 300
end)

---@param targetId number playerId
Expand Down
2 changes: 1 addition & 1 deletion client/setdownedstate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end
CreateThread(function()
while true do
local isDead = exports.qbx_medical:IsDead()
local inLaststand = exports.qbx_medical:GetLaststand()
local inLaststand = exports.qbx_medical:IsLaststand()
if isDead or inLaststand then
if isDead then
handleDead(cache.ped)
Expand Down
6 changes: 4 additions & 2 deletions server/hospital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ local function wipeInventory(src)
end

lib.callback.register('qbx_ambulancejob:server:spawnVehicle', function(source, vehicleName, vehicleCoords)
local netId, veh = qbx.spawnVehicle({ spawnSource = vehicleCoords or source, model = vehicleName, warp = source })
local src = source
local netId, veh = qbx.spawnVehicle({ spawnSource = vehicleCoords or src, model = vehicleName, warp = GetPlayerPed(src)})

local vehType = GetVehicleType(veh)
local platePrefix = (vehType == 'heli') and locale('info.heli_plate') or locale('info.amb_plate')
local plate = platePrefix .. tostring(math.random(1000, 9999))

SetVehicleNumberPlateText(veh, plate)
TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate)
TriggerClientEvent('vehiclekeys:client:SetOwner', src, plate)
return netId
end)

Expand Down

0 comments on commit be3584f

Please sign in to comment.