mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Implemented ESX.Streaming helper
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
function ESX.Streaming.RequestModel(model)
|
||||
local modelHash = GetHashKey(model)
|
||||
|
||||
if not HasModelLoaded(modelHash) then
|
||||
RequestModel(modelHash)
|
||||
|
||||
while not HasModelLoaded(modelHash) do
|
||||
Citizen.Wait(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ESX.Streaming.RequestStreamedTextureDict(textureDict)
|
||||
if not HasStreamedTextureDictLoaded(textureDict) then
|
||||
RequestStreamedTextureDict(textureDict)
|
||||
|
||||
while not HasStreamedTextureDictLoaded(textureDict) do
|
||||
Citizen.Wait(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ESX.Streaming.RequestAnimSet(animSet)
|
||||
if not HasAnimSetLoaded(animSet) then
|
||||
RequestAnimSet(animSet)
|
||||
|
||||
while not HasAnimSetLoaded(animSet) do
|
||||
Citizen.Wait(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ESX.Streaming.RequestAnimDict(animDict)
|
||||
if not HasAnimDictLoaded(animDict) then
|
||||
RequestAnimDict(animDict)
|
||||
|
||||
while not HasAnimDictLoaded(animDict) do
|
||||
Citizen.Wait(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user