📃
Docs
  • 👋Welcome
  • 🌉Bridge
    • 💾Installation
    • 🌐Compatibility
    • 👨Client exports
      • ⏩Framework
        • getName
        • getJob
        • TriggerServerCallback
        • getSex
      • 🎒Inventory
        • getItemCount
      • 👁️Target
    • 🖥️Server exports
      • 🗃️Database
        • getUserData
        • getVehicleData
      • 🎒Inventory
        • openInventory
        • addItem
        • removeItem
        • canCarryItem
        • getItemCount
        • registerStash
        • setDurability
      • ⏩Framework
        • getPlayerFromId
        • getPlayerFromIdentifier
        • getIdentifier
        • RegisterServerCallback
        • getSource
        • getName
        • getJob
        • getAllPlayers
        • setJob
        • doesJobExist
        • getCoords
        • getJobs
  • 🔫Organization Panel
    • 📝Configuration
    • 💾Installation
    • 🗃️Framework integration
      • 💼ESX
        • 🚪ox_doorlock usage
      • 💼QBCore
        • 🚪ox_doorlock usage
      • 💼Other framework
    • 💻Server
      • Server exports
      • Server events
    • 👨Client
      • Client exports
  • ♣️Bossmenu
    • 📝Configuration
    • 💾Installation
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBCore & QBOX
      • 🖼️Other Framework
    • 🖥️Server
      • 🔁Events
      • 🔃Exports
    • 👨Client
      • 🔁Events
      • 🔃Exports
  • 🕺Adjust Animation
    • 🗒️Configuration
    • 💾Installation
    • 📚Other scripts integration
      • 💃scully_emotemenu
      • 💃rpemotes
      • 💃other
  • 👮Police MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBOX/QB-Core
      • 🖼️Other Framework
    • 🚨wk_wars_2x Integration
    • 📚Exports
      • 🔃Server
      • 👨Client
  • 👨‍💼DOJ MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 👨Client
  • 🩺EMS MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 🔃Server
      • 👨Client
Powered by GitBook
On this page

Was this helpful?

  1. Adjust Animation

Configuration

Client config

Config = {}

Config.keys = {
    confirm = {191, 'Enter'},
    cancel = {73, 'X'},
    rleft = {44, 'Q'},
    rright = {38, 'E'},
    up = {45, 'R'},
    down = {23, 'F'},
    left = {34, 'A'},
    right = {35, 'D'},
    forward = {32, 'W'},
    backward = {33, 'S'}
}

Config.Translations = {
    ['title'] = 'Adjust animation',
    ['no_anim'] = 'Use animation first!',
    keys = {
        ['X'] = 'Cancel',
        ['Enter'] = 'Confirm',
        ['Q'] = 'Rot. left',
        ['E'] = 'Rot. right',
        ['R'] = 'Up',
        ['F'] = 'Down',
        ['A'] = 'Left',
        ['D'] = 'Right',
        ['W'] = 'Forward',
        ['S'] = 'Backward'
    }
}

Config.command = 'adjust'

Config.setupPed = function(ped)
    SetEntityInvincible(ped, true)
    SetBlockingOfNonTemporaryEvents(ped, true)
    TaskSetBlockingOfNonTemporaryEvents(ped, true)
    FreezeEntityPosition(ped, true)
end

Config.maxDistance = 30

Config.rotateSpeed = 5

Config.movementSpeed = 0.05

Config.cloneAlpha = 204

Config.returnToStart = true

Config.walkToPosition = true

Config.getCurrentAnimation = function()
    if GetResourceState('scully_emotemenu') == 'started' then
        local data, lastVariant = exports.scully_emotemenu:getLastEmote()
        if not data then return end
        local movementFlag = cache.vehicle and 51 or 0
        if not cache.vehicle and data.Options.Flags then
            if data.Options.Flags.Loop then movementFlag = 1 end
            if data.Options.Flags.Move then movementFlag = 51 end
            if data.Options.Flags.Stuck then movementFlag = 50 end
        end
        if not IsEntityPlayingAnim(cache.ped, data.Dictionary, data.Animation, 3) then return end
        return {
            dict = data.Dictionary,
            anim = data.Animation,
            flag = movementFlag,
            command = 'e ' .. data.Command
        }
    elseif GetResourceState('rpemotes') == 'started' then
        --[[
            =================================================================================================
            Make sure you are using the modified version that is required for the script to function properly
                   https://docs.pixelprecision.dev/adjust-animation/other-scripts-integration/rpemotes
            =================================================================================================
        ]]
        local data = exports.rpemotes:getCurrentEmote()
        if not data then return end
        local MovementType = cache.vehicle and 51 or 0
        if data.AnimationOptions then
            if data.AnimationOptions.EmoteLoop then
                MovementType = 1
                if data.AnimationOptions.EmoteMoving then
                    MovementType = 51
                end
    
            elseif data.AnimationOptions.EmoteMoving then
                MovementType = 51
            elseif data.AnimationOptions.EmoteMoving == false then
                MovementType = 0
            elseif data.AnimationOptions.EmoteStuck then
                MovementType = 50
            end
    
        else
            MovementType = 0
        end
    
        if InVehicle == 1 then
            MovementType = 51
        end
        if not IsEntityPlayingAnim(cache.ped, data[1], data[2], 3) then return end
        return {
            dict = data[1],
            anim = data[2],
            flag = MovementType,
            command = 'e ' .. data[4]
        }
    end
end

Config.Notify = function(message)
    lib.notify({
        title = 'Adjust animation',
        description = message,
        type = 'info'
    })
end
PreviousAdjust AnimationNextInstallation

Last updated 1 year ago

Was this helpful?

🕺
🗒️