mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Add check on instance close
This commit is contained in:
+10
-6
@@ -30,14 +30,18 @@ end
|
||||
|
||||
function CloseInstance(instance)
|
||||
|
||||
for i=1, #Instances[instance].players, 1 do
|
||||
TriggerClientEvent('instance:onClose', Instances[instance].players[i])
|
||||
if Instances[instance] ~= nil then
|
||||
|
||||
for i=1, #Instances[instance].players, 1 do
|
||||
TriggerClientEvent('instance:onClose', Instances[instance].players[i])
|
||||
end
|
||||
|
||||
Instances[instance] = nil
|
||||
|
||||
TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers())
|
||||
|
||||
end
|
||||
|
||||
Instances[instance] = nil
|
||||
|
||||
TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers())
|
||||
|
||||
end
|
||||
|
||||
function AddPlayerToInstance(instance, player)
|
||||
|
||||
Reference in New Issue
Block a user