requestAnim

Requests and loads an animation dictionary with timeout protection.

Parameters:

  • dict (string): The animation dictionary name to load

  • timeout (number, optional): Timeout in milliseconds (default: 15000ms)

Returns:

  • boolean: true if animation dictionary loaded successfully, false if timed out

Example:

-- Request animation dictionary
local success = ps.requestAnim('mp_player_int_upperwank')
if success then
    TaskPlayAnim(PlayerPedId(), 'mp_player_int_upperwank', 'mp_player_int_wank_01', 8.0, -8.0, -1, 49, 0, false, false, false)
    print("Animation started")
else
    print("Failed to load animation dictionary")
end

-- Request with custom timeout
local success = ps.requestAnim('custom_anims', 25000) -- 25 second timeout
if success then
    -- Play custom animation
    TaskPlayAnim(PlayerPedId(), 'custom_anims', 'custom_anim', 8.0, -8.0, 5000, 1, 0, false, false, false)
end

Last updated