mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-11-24 04:18:35 +00:00
Add cleanup of targets when switching players
This commit is contained in:
1 parent
d6c4619717
commit
76855d3246
3 files changed
+12
-4
No files matched your search
+10
-2
@@ -503,8 +503,7 @@ end
|
||||
-- Cleanup on Resource Stop
|
||||
-------------------------------------------------------------
|
||||
|
||||
-- When the current resource stops, remove all targets.
|
||||
onResourceStop(function()
|
||||
local function CleanupTargets()
|
||||
-- Remove entity targets.
|
||||
for i = 1, #targetEntities do
|
||||
if isStarted(OXTargetExport) then
|
||||
@@ -529,4 +528,13 @@ onResourceStop(function()
|
||||
exports[QBTargetExport]:RemoveZone(circleTargets[i].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
onPlayerUnload(function()
|
||||
CleanupTargets()
|
||||
end)
|
||||
|
||||
-- When the current resource stops, remove all targets.
|
||||
onResourceStop(function()
|
||||
CleanupTargets()
|
||||
end, true)
|
||||
Reference in new issue
Block a user