mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
fix: 'no object by ID' warning
This commit is contained in:
@@ -197,11 +197,14 @@ RegisterNetEvent('esx_banking:closebanking', function()
|
|||||||
CloseUi()
|
CloseUi()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
local function loadNPC(index, netID)
|
||||||
local npc
|
CreateThread(function()
|
||||||
for i = 1, #netIdTable do
|
while not NetworkDoesEntityExistWithNetworkId(netID) do
|
||||||
npc = NetworkGetEntityFromNetworkId(netIdTable[i])
|
Wait(1)
|
||||||
TaskStartScenarioInPlace(npc, Config.Peds[i].Scenario, 0, true)
|
end
|
||||||
|
local npc = NetworkGetEntityFromNetworkId(netID)
|
||||||
|
|
||||||
|
TaskStartScenarioInPlace(npc, Config.Peds[index].Scenario, 0, true)
|
||||||
SetEntityProofs(npc, true, true, true, true, true, true, true, true)
|
SetEntityProofs(npc, true, true, true, true, true, true, true, true)
|
||||||
SetBlockingOfNonTemporaryEvents(npc, true)
|
SetBlockingOfNonTemporaryEvents(npc, true)
|
||||||
FreezeEntityPosition(npc, true)
|
FreezeEntityPosition(npc, true)
|
||||||
@@ -209,6 +212,12 @@ RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
|||||||
SetPedCanRagdoll(npc, false)
|
SetPedCanRagdoll(npc, false)
|
||||||
SetEntityAsMissionEntity(npc, true, true)
|
SetEntityAsMissionEntity(npc, true, true)
|
||||||
SetEntityDynamic(npc, false)
|
SetEntityDynamic(npc, false)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
||||||
|
for i = 1, #netIdTable do
|
||||||
|
loadNPC(i, netIdTable[i])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user