mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 06:46:04 +01:00
add function to get animal anim table for that ped
This commit is contained in:
@@ -188,7 +188,33 @@ if not isServer() then
|
|||||||
end
|
end
|
||||||
return animalModels
|
return animalModels
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Compiles and returns a table of animal animations for the ped model.
|
||||||
|
---
|
||||||
|
--- Iterates through every category in AnimalPeds and collects all anims.
|
||||||
|
---
|
||||||
|
--- @return table table A table containing all current model anims.
|
||||||
|
---
|
||||||
|
---@usage
|
||||||
|
--- ```lua
|
||||||
|
--- local getAnim = getAnimalAnims(ped)
|
||||||
|
--- playAnim(getAnim.sitDict, getAnim.sitAnim, -1, 1)
|
||||||
|
--- ```
|
||||||
|
function getAnimalAnims(ped)
|
||||||
|
local model = GetEntityModel(ped)
|
||||||
|
local animalTable = {}
|
||||||
|
for _, animalCategory in pairs(AnimalPeds) do
|
||||||
|
for k, v in pairs(animalCategory) do
|
||||||
|
if k == model then
|
||||||
|
animalTable = v
|
||||||
|
break
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return animalTable
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
-- Animal Models Data
|
-- Animal Models Data
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user