Add debug logging to onClientResourceStop cleanup, bump to 1.1.5

Temporary tracing to diagnose why safe props still show after
resource stop despite DeleteObject being called.
This commit is contained in:
Bxio 2026-08-03 11:58:50 +00:00
parent 091e4864f1
commit d21d04f606
3 changed files with 6 additions and 2 deletions

View File

@ -292,11 +292,15 @@ end)
AddEventHandler('onClientResourceStop', function(resourceName)
if resourceName ~= GetCurrentResourceName() then return end
dbg('onClientResourceStop disparado, limpando', tostring(next(spawnedSafes) and 'safes existentes' or 'nenhum safe'))
for id, ent in pairs(spawnedSafes) do
dbg('safe', id, 'entity', ent, 'DoesEntityExist antes:', DoesEntityExist(ent))
if ent and DoesEntityExist(ent) then
pcall(function() ox_target:removeLocalEntity(ent) end)
FreezeEntityPosition(ent, false)
DeleteObject(ent)
dbg('safe', id, 'DoesEntityExist depois do DeleteObject:', DoesEntityExist(ent))
end
spawnedSafes[id] = nil
end

View File

@ -4,7 +4,7 @@ lua54 'yes'
author 'SeuNome'
description 'Sistema de safes com ox_inventory e ox_target'
version '1.1.4'
version '1.1.5'
-- Dependências
dependencies {

View File

@ -1,3 +1,3 @@
{
"version": "1.1.4"
"version": "1.1.5"
}