Add CloseInstance and instance:close event

This commit is contained in:
Jérémie N'gadi
2017-08-03 15:45:09 +02:00
parent ded115ae9e
commit a4be860555
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -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)
+5
View File
@@ -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)