config.lua

Preview File Updated: v1.0.3 - 03/03/2025

Config = {}

-- ███████╗██████╗  █████╗ ███╗   ███╗███████╗██╗    ██╗ ██████╗ ██████╗ ██╗  ██╗
-- ██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║    ██║██╔═══██╗██╔══██╗██║ ██╔╝
-- █████╗  ██████╔╝███████║██╔████╔██║█████╗  ██║ █╗ ██║██║   ██║██████╔╝█████╔╝ 
-- ██╔══╝  ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝  ██║███╗██║██║   ██║██╔══██╗██╔═██╗ 
-- ██║     ██║  ██║██║  ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║  ██║██║  ██╗
-- ╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝ ╚══╝╚══╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
local frameworkAutoFind = function()
    if GetResourceState('es_extended') ~= 'missing' then
        return "ESX"
    elseif GetResourceState('qb-core') ~= 'missing' then
        return "QB-Core"
    end
end

Config.Core = frameworkAutoFind()
Config.CoreExport = function()
    if Config.Core == "ESX" then
        return exports['es_extended']:getSharedObject()
    elseif Config.Core == "QB-Core" then
        return exports['qb-core']:GetCoreObject()
    end
end

---@field PlayerLoaded string: ESX: "esx:playerLoaded" / QB-Core: "QBCore:Client:OnPlayerLoaded"
Config.PlayerLoaded = Config.Core == "ESX" and "esx:playerLoaded" or "QBCore:Client:OnPlayerLoaded"  

---@field PlayerLogoutServer string: ESX: "esx:playerDropped" / QB-Core: "QBCore:Server:OnPlayerUnload"
Config.PlayerLogoutServer = Config.Core == "ESX" and "esx:playerDropped" or "QBCore:Server:OnPlayerUnload"


-- ███╗   ███╗ █████╗ ██╗███╗   ██╗    ███████╗███████╗████████╗████████╗██╗███╗   ██╗ ██████╗ ███████╗
-- ████╗ ████║██╔══██╗██║████╗  ██║    ██╔════╝██╔════╝╚══██╔══╝╚══██╔══╝██║████╗  ██║██╔════╝ ██╔════╝
-- ██╔████╔██║███████║██║██╔██╗ ██║    ███████╗█████╗     ██║      ██║   ██║██╔██╗ ██║██║  ███╗███████╗
-- ██║╚██╔╝██║██╔══██║██║██║╚██╗██║    ╚════██║██╔══╝     ██║      ██║   ██║██║╚██╗██║██║   ██║╚════██║
-- ██║ ╚═╝ ██║██║  ██║██║██║ ╚████║    ███████║███████╗   ██║      ██║   ██║██║ ╚████║╚██████╔╝███████║
-- ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝    ╚══════╝╚══════╝   ╚═╝      ╚═╝   ╚═╝╚═╝  ╚═══╝ ╚═════╝ ╚══════╝
Config.Notification = function(message, time, type)
    if type == "success" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("REPORT", message, time, "#36f230", "fa-solid fa-flag")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'success', time)
        end
    elseif type == "error" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("REPORT", message, time, "#f23030", "fa-solid fa-flag")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'error', time)
        end
    elseif type == "info" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("REPORT", message, time, "#4287f5", "fa-solid fa-flag")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'primary', time)
        end
    end
end

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


-- ███████╗██╗  ██╗██╗███╗   ██╗███╗   ███╗ █████╗ ███╗   ██╗ █████╗  ██████╗ ███████╗██████╗ 
-- ██╔════╝██║ ██╔╝██║████╗  ██║████╗ ████║██╔══██╗████╗  ██║██╔══██╗██╔════╝ ██╔════╝██╔══██╗
-- ███████╗█████╔╝ ██║██╔██╗ ██║██╔████╔██║███████║██╔██╗ ██║███████║██║  ███╗█████╗  ██████╔╝
-- ╚════██║██╔═██╗ ██║██║╚██╗██║██║╚██╔╝██║██╔══██║██║╚██╗██║██╔══██║██║   ██║██╔══╝  ██╔══██╗
-- ███████║██║  ██╗██║██║ ╚████║██║ ╚═╝ ██║██║  ██║██║ ╚████║██║  ██║╚██████╔╝███████╗██║  ██║
-- ╚══════╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═╝
local skinmanagerAutoFind = function()
    local skinmanagersList = {
        'rcore_clothing', 
        'fivem-appearance', 
        'illenium-appearance', 
        'esx_skin', 
        'qb-clothing', 
        -- 'add_your_custom',
    }
    
    for _, skinmanagerName in ipairs(skinmanagersList) do
        if GetResourceState(skinmanagerName) == 'started' then
            return skinmanagerName
        end
    end

    return nil
end

---@field SkinManager string:
--[[
    - fivem-appearance
    - illenium-appearance
    - esx_skin
    - qb-clothing
    - rcore_clothing

    * If your skinmanger is not in the above list, it can be customized in ./client/bridge/skinmangers/ and ./server/bridge/skinmangers/
]]
Config.SkinManager = skinmanagerAutoFind()


--===============-- █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀ --===============--
--===============-- █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██ --===============--
---@field AutoExecuteQuery boolean:
Config.AutoExecuteQuery = true

Config.CommandName = 'reports'
Config.KeyBind = nil
Config.KeyDescription = nil

---@class CombatLogPed
Config.CombatLogPed = {
    Use = true,

    ReportType = "Combat Log",
    
    CommandName = 'clvisible',
    VisibleTime = 30000,
    VisibleData = {
        steamName = true,
        characterName = true,
        identifier = true,
        reason = true,
        report = true
    },
    reportKey = 38,
    reportLabel = 'Press ~g~[E]~s~ to report',

    DistanceToSee = 3.0,
    DistanceToAccess = 1.5,
}


---@field UseSoundEffects boolean:
Config.UseSoundEffects = true

---@field ScreenshotTimeout number:
Config.ScreenshotTimeout = 5000 -- 5 seconds

---@field DatabaseChatSaving number:
Config.DatabaseChatSaving = 10 * 60 * 1000

---@field DeleteReportOnClose boolean: If the ticket is closed it will be automatically deleted and the Reports History section will not be available.
Config.DeleteReportOnClose = false

---@field SaveBySelfOwnTicketToHistory boolean:
Config.SaveBySelfOwnTicketToHistory = false

---@field ReportsHistoryTimeLimit number: When the number of seconds specified in this option has passed, older reports after this time will be deleted automatically and will no longer be available.
Config.ReportsHistoryTimeLimit = 432000 -- 432000 = 5 days    (If you don't want the reports to delete themselves, set as -1)

---@class Permissions In this section, you can adjust the permissions for each role separately.
Config.Permissions = {
    ["menu.reports_list"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["menu.reports_history"] = {
        admin = true, 
        moderator = true, 
    },
    ["menu.admins_statistics"] = {
        admin = true, 
    },
    ["action.claim"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["action.close"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["action.openinventory"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["action.screenshot"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["action.kick"] = {
        admin = true, 
        moderator = true, 
    },
    ["action.ban"] = {
        admin = true, 
    },
    ["action.teleport_to"] = {
        admin = true, 
        moderator = true, 
        support = true,
    },
    ["action.bring"] = {
        admin = true, 
        moderator = true, 
        support = true,
    }
}

Config.OpenCustomInventory = function(playerId, playerIdentifier, closeOnUse)
    if GetResourceState("qb-inventory") ~= "missing" then
        TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
        closeOnUse()
    else
        -- return true for vms_reports inventory checker
        return true
    end
end

---@class DeathReasons
Config.DeathReasons = {
    -- Undefined:
    ['undefined'] = "Undefined",

    -- Suicide:
    ['suicide'] = "Suicide",
    
    -- Melee:
    ['WEAPON_UNARMED'] = "Beaten by %s using hands.",
    ['WEAPON_CROWBAR'] = "Beaten by %s using crowbar.",
    ['WEAPON_BAT'] = "Beaten by %s using baseball bat.",
    ['WEAPON_GOLFCLUB'] = "Beaten by %s using golf club.",
    ['WEAPON_FLASHLIGHT'] = "Beaten by %s using flashlight.",
    ['WEAPON_KNUCKLE'] = "Beaten by %s using knuckle.",
    ['WEAPON_POOLCUE'] = "Beaten by %s using poolcue.",
    ['WEAPON_WRENCH'] = "Beaten by %s using wrench.",
    ['WEAPON_HAMMER'] = "Beaten by %s using hammer.",
    ['WEAPON_NIGHTSTICK'] = "Beaten by %s using nightstick.",
    ['WEAPON_CANDYCANE'] = "Beaten by %s using candycane",

    -- Fire:
    ['WEAPON_MOLOTOV'] = "Burned by %s using molotov.",

    -- Blade:
    ['WEAPON_DAGGER'] = "Killed by %s using a DAGGER",
    ['WEAPON_KNIFE'] = "Killed by %s using a KNIFE",
    ['WEAPON_SWITCHBLADE'] = "Killed by %s using a SWITCHBLADE",
    ['WEAPON_HATCHET'] = "Killed by %s using a HATCHET",
    ['WEAPON_STONE_HATCHET'] = "Killed by %s using a STONE HATCHET",
    ['WEAPON_MACHETE'] = "Killed by %s using a MACHETE",
    ['WEAPON_BATTLEAXE'] = "Killed by %s using a BATTLEAXE",
    ['WEAPON_BOTTLE'] = "Killed by %s using a BOTTLE",

    -- Pistols:
    ['WEAPON_PISTOL'] = "Shot by %s using PISTOL",
    ['WEAPON_PISTOL_MK2'] = "Shot by %s using PISTOL_MK2",
    ['WEAPON_COMBATPISTOL'] = "Shot by %s using COMBATPISTOL",
    ['WEAPON_APPISTOL'] = "Shot by %s using APPISTOL",
    ['WEAPON_PISTOL50'] = "Shot by %s using PISTOL50",
    ['WEAPON_SNSPISTOL'] = "Shot by %s using SNSPISTOL", 
    ['WEAPON_SNSPISTOL_MK2'] = "Shot by %s using SNSPISTOL_MK2", 
    ['WEAPON_HEAVYPISTOL'] = "Shot by %s using HEAVYPISTOL",
    ['WEAPON_VINTAGEPISTOL'] = "Shot by %s using VINTAGEPISTOL",
    ['WEAPON_MARKSMANPISTOL'] = "Shot by %s using MARKSMANPISTOL",
    ['WEAPON_REVOLVER'] = "Shot by %s using REVOLVER",
    ['WEAPON_REVOLVER_MK2'] = "Shot by %s using REVOLVER_MK2",
    ['WEAPON_DOUBLEACTION'] = "Shot by %s using DOUBLEACTION",
    ['WEAPON_CERAMICPISTOL'] = "Shot by %s using CERAMICPISTOL",
    ['WEAPON_NAVYREVOLVER'] = "Shot by %s using NAVYREVOLVER",
    ['WEAPON_GADGETPISTOL'] = "Shot by %s using GADGETPISTOL",
    ['WEAPON_RAYPISTOL'] = "Shot by %s using RAYPISTOL",
    ['WEAPON_PISTOLXM3'] = "Shot by %s using PISTOL XM3",

    -- SMGs:
    ['WEAPON_MICROSMG'] = "Shot by %s using MICROSMG",
    ['WEAPON_SMG'] = "Shot by %s using SMG",
    ['WEAPON_SMG_MK2'] = "Shot by %s using SMG_MK2",
    ['WEAPON_ASSAULTSMG'] = "Shot by %s using ASSAULTSMG",
    ['WEAPON_COMBATPDW'] = "Shot by %s using COMBATPDW",
    ['WEAPON_MACHINEPISTOL'] = "Shot by %s using MACHINEPISTOL",
    ['WEAPON_MINISMG'] = "Shot by %s using MINISMG",
    ['WEAPON_RAYCARBINE'] = "Shot by %s using RAYCARBINE",
    ['WEAPON_TECPISTOL'] = "Shot by %s using TECPISTOL",

    -- Rifles:
    ['WEAPON_ASSAULTRIFLE'] = "Shot by %s using ASSAULTRIFLE",
    ['WEAPON_ASSAULTRIFLE_MK2'] = "Shot by %s using ASSAULTRIFLE_MK2",
    ['WEAPON_CARBINERIFLE'] = "Shot by %s using CARBINERIFLE",
    ['WEAPON_CARBINERIFLE_MK2'] = "Shot by %s using CARBINERIFLE_MK2",
    ['WEAPON_ADVANCEDRIFLE'] = "Shot by %s using ADVANCEDRIFLE",
    ['WEAPON_SPECIALCARBINE'] = "Shot by %s using SPECIALCARBINE",
    ['WEAPON_SPECIALCARBINE_MK2'] = "Shot by %s using SPECIALCARBINE_MK2",
    ['WEAPON_BULLPUPRIFLE'] = "Shot by %s using BULLPUPRIFLE",
    ['WEAPON_BULLPUPRIFLE_MK2'] = "Shot by %s using BULLPUPRIFLE_MK2",
    ['WEAPON_COMPACTRIFLE'] = "Shot by %s using COMPACTRIFLE",
    ['WEAPON_MILITARYRIFLE'] = "Shot by %s using MILITARYRIFLE",
    ['WEAPON_HEAVYRIFLE'] = "Shot by %s using HEAVYRIFLE",

    -- MGs:
    ['WEAPON_MG'] = "Shot by %s using MG",
    ['WEAPON_COMBATMG'] = "Shot by %s using COMBATMG",
    ['WEAPON_COMBATMG_MK2'] = "Shot by %s using COMBATMG_MK2",
    ['WEAPON_GUSENBERG'] = "Shot by %s using GUSENBERG",

    -- Shotguns:
    ['WEAPON_PUMPSHOTGUN'] = "Shot by %s using PUMPSHOTGUN",
    ['WEAPON_PUMPSHOTGUN_MK2'] = "Shot by %s using PUMPSHOTGUN_MK2",
    ['WEAPON_SAWNOFFSHOTGUN'] = "Shot by %s using SAWNOFFSHOTGUN",
    ['WEAPON_ASSAULTSHOTGUN'] = "Shot by %s using ASSAULTSHOTGUN",
    ['WEAPON_BULLPUPSHOTGUN'] = "Shot by %s using BULLPUPSHOTGUN",
    ['WEAPON_MUSKET'] = "Shot by %s using MUSKET",
    ['WEAPON_HEAVYSHOTGUN'] = "Shot by %s using HEAVYSHOTGUN",
    ['WEAPON_DBSHOTGUN'] = "Shot by %s using DBSHOTGUN",
    ['WEAPON_AUTOSHOTGUN'] = "Shot by %s using AUTOSHOTGUN",
    ['WEAPON_COMBATSHOTGUN'] = "Shot by %s using COMBATSHOTGUN",
    ['WEAPON_TACTICALRIFLE'] = "Shot by %s using TACTICALRIFLE",

    -- Snipers:
    ['WEAPON_SNIPERRIFLE'] = "Shot by %s using SNIPER RIFLE",
    ['WEAPON_HEAVYSNIPER'] = "Shot by %s using HEAVY SNIPER",
    ['WEAPON_HEAVYSNIPER_MK2'] = "Shot by %s using HEAVYSNIPER MK2",
    ['WEAPON_MARKSMANRIFLE'] = "Shot by %s using MARKSMAN RIFLE",
    ['WEAPON_MARKSMANRIFLE_MK2'] = "Shot by %s using MARKSMAN RIFLE MK2",
    ['WEAPON_PRECISIONRIFLE'] = "Shot by %s using PRECISION RIFLE",
    ['WEAPON_REMOTESNIPER'] = "Shot by %s using REMOTESNIPER",

    -- RPG:
    ['WEAPON_RPG'] = "Killed by %s using RPG",
    ['WEAPON_GRENADELAUNCHER'] = "Killed by %s using GRENADELAUNCHER",
    ['WEAPON_FIREWORK'] = "Killed by %s using FIREWORK",
    ['WEAPON_RAILGUN'] = "Killed by %s using RAILGUN",
    ['WEAPON_RAILGUNXM3'] = "Killed by %s using RAILGUN XM3",
    ['WEAPON_HOMINGLAUNCHER'] = "Killed by %s using HOMINGLAUNCHER",
    ['WEAPON_COMPACTLAUNCHER'] = "Killed by %s using COMPACTLAUNCHER",
    ['WEAPON_EMPLAUNCHER'] = "Killed by %s using EMPLAUNCHER",
    ['VEHICLE_WEAPON_TANK'] = "Killed by %s using WEAPON_TANK",

    -- Miniguns:
    ['WEAPON_RAYMINIGUN'] = "Shot by %s using RAYMINIGUN.",
    ['WEAPON_MINIGUN'] = "Shot by %s using MINIGUN.",

    -- Explosions:
    ['WEAPON_GRENADE'] = "Exploded by %s using GRENADE.",
    ['WEAPON_STICKYBOMB'] = "Exploded by %s using STICKYBOMB.",
    ['WEAPON_PROXMINE'] = "Exploded by %s using PROXMINE.",
    ['WEAPON_PIPEBOMB'] = "Exploded by %s using PIPEBOMB.",
    ['WEAPON_EXPLOSION'] = "Exploded by %s using EXPLOSION.",

    -- VDM:
    ['WEAPON_HIT_BY_WATER_CANNON'] = "Killed with water cannon by %s %s (%s).",
    ['WEAPON_RUN_OVER_BY_CAR'] = "Run over by a car by %s %s (%s).",
    ['WEAPON_RAMMED_BY_CAR'] = "Run over by a car by %s %s (%s)",
}

---@class DisconnectReasons
--[[
    
]]
Config.DisconnectReasons = {
    ['kicked'] = '~o~Kicked~s~',
    ['banned'] = '~r~Banned~s~',
    ['exploit'] = '~b~Exploit~s~',

    ['crashed'] = '~y~Crashed~s~',
    ['timed'] = '~b~Timed-out~s~',

    ['exiting'] = '~r~Exited~s~',
    ['afk'] = '~p~AFK~s~',
}

Last updated

Was this helpful?