Full View config.lua

Preview File Updated: v1.2.5 - 13.02.2024

Config = {}

-- Don't touch if you don't know what you're doing --
Config.WhitelistedObject = "prop_amb_beer_bottle"  -- Set here an object that is not on the blacklist or is on the whitelist and can be spawned locally
-----------------------------------------------------

Config.FullyDisableVirtualPed = false -- If you want to fully disable the use and display of the virtual ped set to true

Config.CoreDefine = function()
    return exports['es_extended']:getSharedObject()
    -- return exports['qb-core']:GetCoreObject()
end

Config.GetClosestPlayerFunction = function()
    local player, distance = Core.Game.GetClosestPlayer() -- ESX
    -- local player, distance = Core.Functions.GetClosestPlayer(GetEntityCoords(PlayerPedId())) -- QB-CORE
    return player, distance
end

Config.Hud = {
    Enable = function()
        -- exports['vms_hud']:Display(true)
    end,
    Disable = function()
        -- exports['vms_hud']:Display(false)
    end
}

Config.CheckingBeforeOpenMenu = function() -- You can add a check that, for example, the player is not handcuffed before opening menu
    -- if not exports['handcuffs']:isHandcuffed() then
        return true
    -- else
    --     Config.Notification('You cannot open animation menu right now', 'error')
    --     return false
    -- end
end

Config.CheckingBeforeStartAnimation = function() -- You can add a check that, for example, the player is not handcuffed before starting the animation
    -- if not exports['handcuffs']:isHandcuffed() then
        return true
    -- else
    --     Config.Notification('You cannot start animation right now', 'error')
    --     return false
    -- end
end

Config.UseCustomQuestionMenu = false -- if you want to use for example vms_notify Question Menu, set it true, if you want to use Question Menu from vms_anims set it false
Config.CustomQuestionMenu = function(requesterId, animTable)
    local question = exports['vms_notify']:Question(Config.Texts["question_title"], Config.Texts["question_description"]:format(requesterId, animTable.Label), '#4f64ff', 'fa-solid fa-people-arrows')
    Citizen.Await(question)
    if question == 'y' then -- vms_notify question export return 'y' when player accept and 'n' when player reject
        TriggerServerEvent("vms_anims:sv:acceptAnim", requesterId, animTable)
    end
end
Config.DefaultQuestionMenuKeys = { -- vms_anims has a built-in question menu for synchronized animations, here you can customize the keys
    ['accept'] = {id = 246, ui = "Y"}, -- id = https://docs.fivem.net/docs/game-references/controls/, ui = letter on ui telling the key
    ['reject'] = {id = 306, ui = "N"},
}


Config.NoPlayersAroundStartOnlyOnMe = true -- if the player wants to run a synchronized animation but no one is around, the animation will run on him only
Config.EnableSelfSyncedAnim = true -- If you have this running it will cause you to be able to change the player to yourself with a key when looking for a player for a synchronized animation

Config.EnabledOptionsWithJoin = {
    ['VirtualPed'] = true,
    ['Move'] = false,
    ['Loop'] = true,
}

Config.EnableMovingWithUI = true
Config.EnableMovingLoopRefreshTime = 3

Config.CommandName = "animations"
Config.KeyDescription = "Open Animation Panel"
Config.KeyBind = "F3"

Config.AnimAdjustCommandName = "adjustanim"
Config.AnimAdjustKeyDescription = nil
Config.AnimAdjustKeyBind = nil

Config.AdjustedTeleportBack = true

Config.DisableKeyBindWhileDead = true

Config.CancelKey = 73 -- 73 = X | Cancels animations

Config.AnimCommand = "e"

Config.WalkingTransition = 0.5

Config.RunAnimWhileRunned = true -- If true, you will be able to turn on an animation without turning off the previous one, if false, you will have to stop the currently playing animation before starting the next one
Config.DisableRunNextPositionedAnim = true -- If true, it will block the possibility of bugging the positioned animation so they can't try to fly, we recommend enabling this
Config.NotLoopedAnimTime = 4500 -- remember that after this time will remove the animation object from the virtual ped

Config.VirtualPedPreviewWalkingTime = 4000 -- 4 seconds

Config.CloseUiWhenPlayerRunSyncedAnim = true
Config.CloseUiWhenPlayerRunPositioningAnim = true

Config.DrawPositionBorder = true -- If you want the player to have a rendered area in which to manage the position of the animation
Config.PositionBordarColor = {244, 10, 30, 30} -- Red Green Blue Alpha
Config.PositionBorderSize = 2.0
Config.ArrowSpeed = 0.01
Config.UpDownSpeed = 0.02
Config.HeadingSpeed = 10.0
Config.PositionKeys = {
    ["FORWARD"] = 172, -- ARROW UP
    ["BACK"] = 173, -- ARROW DOWN
    ["LEFT"] = 174, -- ARROW LEFT
    ["RIGHT"] = 175, -- ARROW RIGHT
    ["UP"] = 38, -- E
    ["DOWN"] = 44, -- Q
    ["ROTATE_LEFT"] = 15, -- SCROLL UP
    ["ROTATE_RIGHT"] = 14, -- SCROLL DOWN
    ["SET"] = 176, -- ENTER
    ["SLOW"] = 36 -- LEFT CTRL
}

Config.Texts = {
    ["added"] = "Animation added to favorite.",
    ["remove"] = "Animation removed from favorite.",
    ["not_exist"] = "Animation command /"..Config.AnimCommand.." %s not exist",
    ['already_adjusted'] = "You have already adjusted animation position.",
    ["no_favorites"] = "You dont have any favorite animation, to add favorite double-press on it.",
    ["is_falling"] = "You can't run animation while falling.",
    ["now_playing_anim"] = "You can't start another animation until you stop this one.",
    ["cannot_play_in_vehicle"] = "You can't start this animation in the vehicle.",
    ["sent_sync_anim_request"] = "Animation request sent to player %s",
    ["not_closest_player"] = "No people around",
    ["question_title"] = "SYNCED ANIMATION",
    ["question_description"] = "Player [%s] want to play anim %s with you.",
}

Config.Notification = function(msg, type)
    if type == "success" then
        exports["vms_notify"]:Notification("ANIMATIONS", msg, 3000, "#32a852", "fa fa-check-circle-o")
    elseif type == "error" then
        exports["vms_notify"]:Notification("ANIMATIONS", msg, 3000, "#eb4034", "fa fa-exclamation-circle")
    end
end

Last updated