Full View config.lua

Preview File Updated: v1.0.1 - 11.11.2023

Config = {}

--====================-- █▀ █▀▄ ▄▀▄ █▄ ▄█ ██▀ █   █ ▄▀▄ █▀▄ █▄▀ --====================--
--====================-- █▀ █▀▄ █▀█ █ ▀ █ █▄▄ ▀▄▀▄▀ ▀▄▀ █▀▄ █ █ --====================--

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

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

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

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
}


--===============-- █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀ --===============--
--===============-- █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██ --===============--

Config.AutoExecuteQuery = true

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


Config.UseSoundEffects = true

Config.ScreenshotTimeout = 5000 -- 5 seconds

Config.DatabaseChatSaving = 10 * 60 * 1000

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

-- @SaveBySelfOwnTicketToHistory:
Config.SaveBySelfOwnTicketToHistory = false

-- @ReportsHistoryTimeLimit: 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)

-- @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

Config.GetDeathStatus = function()
    if Config.Core == "ESX" then
        return IsEntityDead(PlayerPedId())
    else
        -- In default qb-core player is not death, it's just play an animation.
        return false
    end
end

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.",

    -- 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",

    -- 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",

    -- 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",

    -- Snipers:
    ['WEAPON_SNIPERRIFLE'] = "Shot by %s using SNIPERRIFLE",
    ['WEAPON_HEAVYSNIPER'] = "Shot by %s using HEAVYSNIPER",
    ['WEAPON_HEAVYSNIPER_MK2'] = "Shot by %s using HEAVYSNIPER_MK2",
    ['WEAPON_MARKSMANRIFLE'] = "Shot by %s using MARKSMANRIFLE",
    ['WEAPON_MARKSMANRIFLE_MK2'] = "Shot by %s using MARKSMANRIFLE_MK2",
    ['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_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_RUN_OVER_BY_CAR'] = "Run over by a car by %s %s.",
    ['WEAPON_RAMMED_BY_CAR'] = "Run over by a car by %s %s",
}

Last updated