This commit is contained in:
MrNewb committed 2025-04-29 16:22:46 -04:00
1 parent c23df31199
commit f44d76c791
2 files changed
+20 -24

No files matched your search

+8 -9
View File
@@ -365,16 +365,15 @@ Utility.RemovePoint = function(pointID)
end end
AddEventHandler('onResourceStop', function(resource) AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then if resource ~= GetCurrentResourceName() then return end
for _, blip in pairs(blipIDs) do for _, blip in pairs(blipIDs) do
if blip and DoesBlipExist(blip) then if blip and DoesBlipExist(blip) then
RemoveBlip(blip) RemoveBlip(blip)
end
end end
for _, ped in pairs(spawnedPeds) do end
if ped and DoesEntityExist(ped) then for _, ped in pairs(spawnedPeds) do
DeleteEntity(ped) if ped and DoesEntityExist(ped) then
end DeleteEntity(ped)
end end
end end
end) end)
+12 -15
View File
@@ -162,11 +162,10 @@ RegisterNetEvent("playerJoining", function()
end) end)
AddEventHandler('onResourceStart', function(resource) AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then if resource ~= GetCurrentResourceName() then return end
Wait(1000) Wait(1000)
for _, src in pairs(GetPlayers()) do for _, src in pairs(GetPlayers()) do
ReboundEntities.Refresh(src) ReboundEntities.Refresh(src)
end
end end
end) end)
@@ -307,20 +306,18 @@ end)
RegisterNetEvent(GetCurrentResourceName() .. ":client:SetReboundSyncData", function(id, key, value) RegisterNetEvent(GetCurrentResourceName() .. ":client:SetReboundSyncData", function(id, key, value)
local entityData = ReboundEntities.GetById(id) local entityData = ReboundEntities.GetById(id)
if entityData then if not entityData then return end
entityData[key] = value entityData[key] = value
if entityData.onSyncKeyChange then if entityData.onSyncKeyChange then
entityData.onSyncKeyChange(entityData, key, value) entityData.onSyncKeyChange(entityData, key, value)
end
end end
end) end)
AddEventHandler('onResourceStop', function(resource) AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then if resource ~= GetCurrentResourceName() then return end
spawnLoopRunning = false spawnLoopRunning = false
for _, entity in pairs(Entities) do for _, entity in pairs(Entities) do
if entity.entity then DeleteEntity(tonumber(entity.entity)) end if entity.entity then DeleteEntity(tonumber(entity.entity)) end
end
end end
end) end)