From d66981bf5aab1533af34d40451ad3732f60afdca Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 2 Dec 2018 17:42:33 +0100 Subject: [PATCH] Load property IPLs when spawning in property --- client/main.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/main.lua b/client/main.lua index 0adecf7e..3c8dcfe1 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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