requestAnimDict
Load an animation dictionary and wait until it's ready, before any TaskPlayAnim.
Load an animation dictionary and wait until it's ready, before any TaskPlayAnim.
lib.requestAnimDict(animDict, timeout?) loads an animation dictionary and blocks until it's ready —
call it before any TaskPlayAnim. Returns the dict name. If you just want to play an animation,
lib.playAnim already does this for you.
local dict = 'amb@world_human_smoking@male@male_a@base'
lib.requestAnimDict(dict)
TaskPlayAnim(PlayerPedId(), dict, 'base', 8.0, -8.0, -1, 1, 0.0, false, false, false)
RemoveAnimDict(dict)animDictstringrequiredDictionary name, e.g. amb@world_human_smoking@male@male_a@base.
timeoutnumberoptionalMax wait in ms. Default 30000.
Returns the loaded dict name. Throws after the timeout if it never loads — wrap it in pcall to handle
failure without killing the thread.
local ok = pcall(lib.requestAnimDict, 'mp_common', 3000)
if not ok then return endRelease the dict with RemoveAnimDict(dict) once the animation is done, or streaming keeps it in
memory. The name is case-sensitive — one wrong character means the dict is never found, so you wait
the full timeout then throw. Unlike requestModel, there's no upfront validation: an invalid name
silently waits the whole timeout. It's built on top of lib.streamingRequest.