Speaking staff;
Well I have a server MTA DayZ and was wondering how do i add an animation when the player opens the inventory (animation squat), I already have a code but does not work, the code is this:
--Code
function showInventory(key, keyState)
if getElementData(getLocalPlayer(), "logedin") and keyState == "down" then
guiSetVisible(inventoryWindows, not guiGetVisible(inventoryWindows))
showCursor(not isCursorShowing())
refreshInventory()
if guiGetVisible(inventoryWindows) == true then
onClientOpenInventoryStopMenu()
setPedAnimation(source, "BOMBER", "BOM_Plant_Crouch_Out", nil, false, false, false, true)
else
hideRightClickInventoryMenu()
setPedAnimation(source, "BOMBER", "BOM_Plant_Loop", nil, false, false, nil, false)
end
if isPlayerInLoot() then
local col = getElementData(getLocalPlayer(), "currentCol")
local gearName = getElementData(getLocalPlayer(), "lootname")
refreshLoot(col, gearName)
end
end
end
bindKey("j", "down", showInventory)
function showInventoryManual ()
guiSetVisible(inventoryWindows,not guiGetVisible(inventoryWindows))
showCursor(not isCursorShowing())
refreshInventory()
if guiGetVisible(inventoryWindows) == true then
onClientOpenInventoryStopMenu ()
end
end