mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
Add CloseInstance and instance:close event
This commit is contained in:
@@ -30,6 +30,10 @@ function CreateInstance()
|
||||
TriggerServerEvent('instance:create')
|
||||
end
|
||||
|
||||
function CloseInstance()
|
||||
TriggerServerEvent('instance:close')
|
||||
end
|
||||
|
||||
function EnterInstance(instance)
|
||||
TriggerServerEvent('instance:enter', InstanceInvite.host)
|
||||
end
|
||||
@@ -59,6 +63,10 @@ AddEventHandler('instance:create', function()
|
||||
CreateInstance()
|
||||
end)
|
||||
|
||||
AddEventHandler('instance:close', function()
|
||||
CloseInstance()
|
||||
end)
|
||||
|
||||
AddEventHandler('instance:enter', function(instance)
|
||||
EnterInstance(instance)
|
||||
end)
|
||||
|
||||
@@ -96,6 +96,11 @@ AddEventHandler('instance:create', function()
|
||||
CreateInstance(source)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('instance:close')
|
||||
AddEventHandler('instance:close', function()
|
||||
CloseInstance(source)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('instance:enter')
|
||||
AddEventHandler('instance:enter', function(instance)
|
||||
AddPlayerToInstance(instance, source)
|
||||
|
||||
Reference in New Issue
Block a user