Fix typo + add some events

This commit is contained in:
Jérémie N'gadi
2017-09-13 14:48:38 +02:00
parent f34ea3c42f
commit f9936dc41d
2 changed files with 13 additions and 8 deletions
+11 -7
View File
@@ -37,7 +37,7 @@ function CloseInstance()
end
function EnterInstance(instance)
TriggerServerEvent('instance:enter', instance.host)
if RegisteredInstanceTypes[instance.type].enter ~= nil then
@@ -63,8 +63,8 @@ function LeaveInstance()
end
function InviteToInstance(type, player, pos)
TriggerServerEvent('instance:invite', Instance.host, type, player, pos)
function InviteToInstance(type, player, data)
TriggerServerEvent('instance:invite', Instance.host, type, player, data)
end
function RegisterInstanceType(type, enter, exit)
@@ -94,8 +94,8 @@ AddEventHandler('instance:leave', function()
LeaveInstance()
end)
AddEventHandler('instance:invite', function(type, player, pos)
InviteToInstance(type, player, pos)
AddEventHandler('instance:invite', function(type, player, data)
InviteToInstance(type, player, data)
end)
AddEventHandler('instance:registerType', function(name, enter, exit)
@@ -130,13 +130,13 @@ end)
RegisterNetEvent('instance:onPlayerEntered')
AddEventHandler('instance:onPlayerEntered', function(instance, player)
Instance = instance
ShowNotification(GetPlayerName(GetPlayerFromServerId(player)) .. _U('entered_into'))
ShowNotification(GetPlayerName(GetPlayerFromServerId(player)) .. _('entered_into'))
end)
RegisterNetEvent('instance:onPlayerLeft')
AddEventHandler('instance:onPlayerLeft', function(instance, player)
Instance = instance
ShowNotification(GetPlayerName(GetPlayerFromServerId(player)) .. _U('left_out'))
ShowNotification(GetPlayerName(GetPlayerFromServerId(player)) .. _('left_out'))
end)
RegisterNetEvent('instance:onInvite')
@@ -269,3 +269,7 @@ Citizen.CreateThread(function()
end
end)
Citizen.CreateThread(function()
TriggerEvent('instance:loaded')
end)