refactor(streaming): convert to modules

Import methods rather than call via exports.
This commit is contained in:
Linden
2022-11-21 21:39:01 +11:00
parent 6825103dd5
commit 00c2086072
9 changed files with 213 additions and 86 deletions

View File

@@ -26,7 +26,10 @@ local function createProp(prop)
lib.requestModel(prop.model)
local coords = GetEntityCoords(cache.ped)
local object = CreateObject(prop.model, coords.x, coords.y, coords.z, true, true, true)
AttachEntityToEntity(object, cache.ped, GetPedBoneIndex(cache.ped, prop.bone or 60309), prop.pos.x, prop.pos.y, prop.pos.z, prop.rot.x, prop.rot.y, prop.rot.z, true, true, false, true, 0, true)
SetModelAsNoLongerNeeded(prop.model)
return object
end
@@ -44,10 +47,14 @@ local function startProgress(data)
if data.anim then
if data.anim.dict then
lib.requestAnimDict(data.anim.dict)
TaskPlayAnim(cache.ped, data.anim.dict, data.anim.clip, data.anim.blendIn or 3.0, data.anim.blendOut or 1.0, data.anim.duration or -1, data.anim.flag or 49, data.anim.playbackRate or 0, data.anim.lockX, data.anim.lockY, data.anim.lockZ)
RemoveAnimDict(data.anim.dict)
data.anim = true
elseif data.anim.scenario then
TaskStartScenarioInPlace(cache.ped, data.anim.scenario, 0, data.anim.playEnter ~= nil and data.anim.playEnter or true)
data.anim = true
end
end