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
|
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)
|
||||||
@@ -376,7 +376,6 @@ AddEventHandler('onResourceStop', function(resource)
|
|||||||
DeleteEntity(ped)
|
DeleteEntity(ped)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
exports('Utility', Utility)
|
exports('Utility', Utility)
|
||||||
|
|||||||
@@ -162,12 +162,11 @@ 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)
|
||||||
|
|
||||||
::client::
|
::client::
|
||||||
@@ -307,21 +306,19 @@ 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)
|
||||||
|
|
||||||
return ReboundEntities
|
return ReboundEntities
|
||||||
Reference in new issue
Block a user