guards
This commit is contained in:
1 parent
c23df31199
commit
f44d76c791
2 files changed
+4
-8
No files matched your search
@@ -365,7 +365,7 @@ Utility.RemovePoint = function(pointID)
|
||||
end
|
||||
|
||||
AddEventHandler('onResourceStop', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
if resource ~= GetCurrentResourceName() then return end
|
||||
for _, blip in pairs(blipIDs) do
|
||||
if blip and DoesBlipExist(blip) then
|
||||
RemoveBlip(blip)
|
||||
@@ -376,7 +376,6 @@ AddEventHandler('onResourceStop', function(resource)
|
||||
DeleteEntity(ped)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
exports('Utility', Utility)
|
||||
|
||||
@@ -162,12 +162,11 @@ RegisterNetEvent("playerJoining", function()
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
if resource ~= GetCurrentResourceName() then return end
|
||||
Wait(1000)
|
||||
for _, src in pairs(GetPlayers()) do
|
||||
ReboundEntities.Refresh(src)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
::client::
|
||||
@@ -307,21 +306,19 @@ end)
|
||||
|
||||
RegisterNetEvent(GetCurrentResourceName() .. ":client:SetReboundSyncData", function(id, key, value)
|
||||
local entityData = ReboundEntities.GetById(id)
|
||||
if entityData then
|
||||
if not entityData then return end
|
||||
entityData[key] = value
|
||||
if entityData.onSyncKeyChange then
|
||||
entityData.onSyncKeyChange(entityData, key, value)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStop', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
if resource ~= GetCurrentResourceName() then return end
|
||||
spawnLoopRunning = false
|
||||
for _, entity in pairs(Entities) do
|
||||
if entity.entity then DeleteEntity(tonumber(entity.entity)) end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return ReboundEntities
|
||||
Reference in new issue
Block a user