Load property IPLs when spawning in property

This commit is contained in:
ElPumpo
2018-12-02 17:42:33 +01:00
parent 7b8329878f
commit d66981bf5a
+10
View File
@@ -752,6 +752,16 @@ AddEventHandler('playerSpawned', function()
ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName)
if propertyName ~= nil then
if propertyName ~= '' then
local property = GetProperty(propertyName)
for i=1, #property.ipls, 1 do
RequestIpl(property.ipls[i])
while not IsIplActive(property.ipls[i]) do
Citizen.Wait(0)
end
end
TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier})
end
end