Samuel's Development, Official Documentation
  • 🎉Welcome
  • 📑Overview
    • Resources
      • Bobcat Weapon Heist
        • Installation Guide
        • Configuration
      • Traphouse Robbery
        • Installation Guide
        • Configuration
      • Pacific Bank Heist
        • Installation Guide
        • Configuration
      • Oxy Run
        • Installation Guide
        • Configuration
      • Dumpster Diving
        • Installation Guide
        • Configuration
        • Log Configuration
      • Warehouse Heist
        • Installation Guide
        • Configuration
      • Oil Rig
        • Installation Guide
        • Configuration
      • Beekeeping
        • Installation Guide
        • Configuration
        • Log Configuration
      • Yacht Robbery
        • Installation Guide
        • Configuration
      • Notify
        • Installation
        • Configuration
      • Cocaine Mission
        • Installation Guide
        • Configuration
      • Advanced Drug Sales
        • Installation Guide
        • Configuration
    • Library
      • Installation & Integration
      • Modules
        • Client
          • Callback
          • StartProgress
          • LoadAnim
          • LoadModel
          • LoadPtfxAsset
          • ShowNotification
          • SendEmail
          • PoliceDispatch
          • StartHack
        • Server
          • Callback
          • Name
          • Money
          • Logger
          • Inventory
          • HasGroup
          • GetPlayer
          • GetPlayers
          • GetPlayerByIdentifier
          • GetIdentifier
          • GetPlayerGender
          • CheckVersion
        • Shared
          • Array
          • Table
          • String
          • Math
          • Locale
            • JSON Example
          • AwaitLoad
          • Framework
  • 📚F.A.Q
    • How do I change Locales?!
    • How to add Police Alerts?!
    • What types of dirty money are supported?
Powered by GitBook
On this page
  1. Overview
  2. Library
  3. Modules

Client

SD.LoadAnim

SD.LoadAnim = function(animDict)
    if type(animDict) ~= "string" then
        error("Animation dictionary identifier must be a string.")
    end

    if not HasAnimDictLoaded(animDict) then
        RequestAnimDict(animDict)

        -- Use sd.awaitLoad to wait for the animation dictionary to load with a timeout.
        SD.AwaitLoad(function()
            if HasAnimDictLoaded(animDict) then
                return true -- Return true indicating the dictionary is loaded.
            end
        end, ("Failed to load animation dictionary '%s'"):format(animDict), 5000) -- 5000 ms timeout.
    end
end

return SD.LoadAnim

Usage Example:

-- Load an animation dictionary named 'anim@heists@ornate_bank@grab_cash'.
SD.LoadAnim('anim@heists@ornate_bank@grab_cash')

This function SD.LoadAnim ensures that the specified animation dictionary is loaded into the game. It takes one parameter:

  • animDict (string): The name of the animation dictionary to be loaded.

This function is asynchronous, meaning it does not block execution of subsequent code.

PreviousModulesNextCallback

Last updated 1 year ago

📑