Skip to content

Commit

Permalink
refactor: bpt_ambulancejob reconstruction to fix bugs found
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jan 8, 2025
1 parent d3a6859 commit 313776e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end

function EndDeathCam()
RenderScriptCams(false, false, 0, false, false)
camera = DestroyCam(camera)
DestroyCam(camera, false)
end

function ProcessCamControls()
Expand All @@ -34,7 +34,7 @@ function ProcessCamControls()
end

local coords = ProcessNewPosition(playerCoords)
SetCamCoord(camera, coords)
SetCamCoord(camera, coords.x, coords.y, coords.z)
PointCamAtCoord(camera, playerCoords.x, playerCoords.y, playerCoords.z)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@diagnostic disable: undefined-global

local CurrentAction, CurrentActionMsg, CurrentActionData, billing = nil, "", {}, {}
local HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum
local IsBusy, deadPlayers, deadPlayerBlips, isOnDuty = false, {}, {}, false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
local firstSpawn = true
IsDead, IsSearched, Medic = false, false, 0

Expand Down Expand Up @@ -39,7 +40,7 @@ end)
-- Create blips
CreateThread(function()
for k, v in pairs(Config.Hospitals) do
local blip = AddBlipForCoord(v.Blip.coords)
local blip = AddBlipForCoord(v.Blip.coords.x, v.Blip.coords.y, v.Blip.coords.z)

SetBlipSprite(blip, v.Blip.sprite)
SetBlipScale(blip, v.Blip.scale)
Expand Down Expand Up @@ -330,11 +331,11 @@ end

function RespawnPed(ped, coords, heading)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, 1, false)
SetPlayerInvincible(ped, false)
ClearPedBloodDamage(ped)

TriggerEvent("esx_basicneeds:resetStatus")
TriggerEvent("bpt_basicneeds:resetStatus")
TriggerServerEvent("esx:onPlayerSpawn")
TriggerEvent("esx:onPlayerSpawn")
TriggerEvent("playerSpawned") -- compatibility with old scripts, will be removed soon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
local spawnedVehicles = {}

function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Config.LoadIpl = false -- Disable if you're using fivem-ipl or other IPL loaders

Config.Locale = "it"

Config.EarlyRespawnTimer = 60000 * 1 -- time til respawn is available
Config.EarlyRespawnTimer = 60000 * 10 -- time til respawn is available
Config.BleedoutTimer = 60000 * 10 -- time til the player bleeds out

Config.EnablePlayerManagement = true -- Enable society managing (If you are using bpt_society).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@diagnostic disable: undefined-global

local playersHealing, deadPlayers = {}, {}

if GetResourceState("npwd") ~= "missing" then
Expand Down Expand Up @@ -42,7 +44,7 @@ AddEventHandler("bpt_ambulancejob:revive", function(playerId)
xPlayer.triggerEvent("bpt_ambulancejob:PlayerNotDead", playerId)
end
end
deadPlayers[playerId] = nil
deadPlayers[playerId] = "distress"
else
xPlayer.showNotification(TranslateCap("player_not_unconscious"))
end
Expand Down

0 comments on commit 313776e

Please sign in to comment.