EZ Scripts
DiscordTebex
  • 💡Welcome To EZ Scripts
  • FIVEM
    • 🍀EZ White Widow
      • Config File
      • Add more locations
      • Common Issues
    • 🟣EZ Lean Drug
      • Config File
      • Add more locations
    • ❄️EZ Coke & Crack Drug
      • Config File
      • Add more locations
    • 🔠EZ Plate Changer
      • Config File
    • 📑Ez Lib
      • Config File
    • 🛡️Ez Admin Authority
      • Config File
    • 🫳Ez Item Spawner
      • Config File
      • Permission Check
      • Add Item
      • Get Items
  • RedM
    • 💼EZ Society & Job Meny
      • Config File
      • Exports
      • Syn Society
    • 🌍EZ Fast Travel
      • Config File
    • 🛡️Ez Admin Authority
      • Config File
    • 🍖Ez Consumables
      • Config File
    • 📺Ez HUD
      • Config File
      • Exports and Events
    • 🚷EZ Combat Logging
      • Config File
    • 🗽EZ Life Style
      • Getting Life Style
      • Config File
    • ☢️EZ Radial Menu
      • Config File
    • 🫳Ez Item Spawner
      • Config File
      • Permission Check
      • Add Item
      • Get Items
Powered by GitBook
On this page

Was this helpful?

  1. RedM
  2. Ez Admin Authority

Config File

PreviousEz Admin AuthorityNextEz Consumables

Last updated 5 months ago

Was this helpful?

🛡️
https://github.com/EZ-Scripts/ez_admin/blob/main/config.lua
Config = {
    Commands = {
        ban =       {list = "players",  type = "banPlayer",     description = "Ban a player using ban menu"},
        kick =      {list = "players",  type = "kickPlayer",    description = "Kick a player"},
        warn =      {list = "players",  type = "warnPlayer",    description = "Warn a player"},
        comserve =      {list = "players",  type = "comsPlayer",    description = "Comserve a player"},
        unban =     {list = "bans",     type = "manageBans",    description = "Unban a player"},
        endcomserve =   {list = "coms",     type = "manageComs",    description = "End comservation for a player"},
    },

    Permission = function(source, type) -- Type is the command type from above ("banPlayer", "kickPlayer", "warnPlayer", "comsPlayer", "manageBans", "manageComs")
        if source == 0 then
            return false -- server side txadmin cannot open menu
        end
        
        -- Example of using Admin Group For VORP CORE 
        --[[if Core == nil then
            Core = exports.vorp_core:GetCore()
        end
        local user = Core.getUser(source)
        if user.getGroup == "admin" then
            return true
        end
        return false]]

        -- Example of using Player Ace Standalone
        return IsPlayerAceAllowed(source, "ez_admin:"..type)
    end,

    Notify = function(message, type, source)
        local title = "Success"
        if type == "error" then
            title = "Error"
        end
        if source then
            if source == 0 then
                print(message)
                return
            end
            TriggerClientEvent('ez_admin:notify', source, title, message, 5000)
        else
            TriggerEvent('ez_admin:notify', title, message, 5000)
        end
    end,

    BanChecks = {
        ip = false, -- DO NOT USE IF YOU HAVE HIDDEN PLAYER IPS ON PLAYER CFX LIST
        license = true, -- DO NOT DISABLE
        discord = true,
    }
}

Config.Coms = {
    Location = {
        coord = vector3(-589.46, -744.04, 36.28), -- The location of the comservation area
        radius = 75, -- The radius of the comservation area
    },
    PenaltyIfLeft = 2, -- amount; How many amount to add to comservation amount if player leaves comservation area (default: 2)
    Task = {
        key = 38, -- control key; The key to press to do task (default: 38) | For RedM change to 0xCEFD9220
        time = 5000, -- milliseconds; How long it takes to complete one task (default: 5000)
        -- These are locations where to do task, renews every cycle (once all complete and amount still remaining)
        -- Locations must be within the radius of the main area of coms
        locations = {
            {coord = vector3(-583.31, -746.43, 36.28),},
            {coord = vector3(-596.68, -738.5, 36.29),},
            {coord = vector3(-583.42, -732.26, 36.28),},
            {coord = vector3(-600.5, -730.14, 36.29),},
            {coord = vector3(-609.87, -744.08, 36.29),},
            {coord = vector3(-603.58, -749.76, 36.29),},
            {coord = vector3(-594.52, -749.54, 36.29),},
            {coord = vector3(-585.26, -750.56, 36.28),},
        },
        playAnim = function()
            RequestAnimDict("anim@amb@drug_field_workers@rake@male_a@base")
            while not HasAnimDictLoaded("anim@amb@drug_field_workers@rake@male_a@base") do
                Wait(100)
            end
            TaskPlayAnim(PlayerPedId(), "anim@amb@drug_field_workers@rake@male_a@base", "base", 8.0, 8.0, -1, 1, 0, false, false, false)
            prop = CreateObject(GetHashKey("prop_tool_broom"), 0.0, 0.0, 0.0, true, true, true)
            AttachEntityToEntity(prop, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01, 0.04, -0.03, 0.0, 0.0, 0.0, true, true, false, true, 1, true)
        end,
        endAnim = function()
            ClearPedTasks(PlayerPedId())
            DeleteEntity(prop)
        end,
        whenPlayerClose = function(coord) -- Client side function what to do when player close to task location
            local onScreen, _x, _y = World3dToScreen2d(coord.x, coord.y, coord.z)
            if onScreen then
                SetTextScale(0.35, 0.35)
                SetTextFont(4)
                SetTextProportional(1)
                SetTextColour(255, 255, 255, 215)
                SetTextDropShadow(0, 0, 0, 55)
                SetTextEdge(0, 0, 0, 150)
                SetTextDropShadow()
                SetTextOutline()
                SetTextEntry("STRING")
                SetTextCentre(1)
                AddTextComponentString("[E] to clean")
                DrawText(_x,_y)
            end
        end,
        drawMarker = function(coord) -- Client side function to draw marker, Delete code inside if not wanted
            DrawMarker(27, coord.x, coord.y, coord.z-0.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, true, 2, nil, nil, nil, false)
        end,
        rubbishProp = "proc_litter_01", -- Optional: Redm p_cs_sackcorn01x | Fivem proc_litter_01
    },
}

if GetGameName() == "redm" then
    Config.Coms = {
        Location = {
            coord = vector3(2591.01, -1201.96, 53.91), -- The location of the comservation area
            radius = 100, -- The radius of the comservation area
        },
        PenaltyIfLeft = 2, -- amount; How many amount to add to comservation amount if player leaves comservation area (default: 2)
        Task = {
            key = 0x760A9C6F, -- control key; The key to press to do task (default is E: 38) | For RedM G change to 0x760A9C6F
            time = 5000, -- milliseconds; How long it takes to complete one task (default: 5000)
            -- These are locations where to do task, renews every cycle (once all complete and amount still remaining)
            -- Locations must be within the radius of the main area of coms
            locations = {
                {coord = vector3(2583.0518, -1213.4706, 53.9251),},
                {coord = vector3(2566.5381, -1218.7795, 53.9038),},
                {coord = vector3(2556.7456, -1210.8679, 53.9088),},
                {coord = vector3(2554.3701, -1199.9381, 53.9085),},
                {coord = vector3(2560.0305, -1189.8553, 53.9110),},
                {coord = vector3(2574.0483, -1185.9275, 53.9064),},
                {coord = vector3(2567.7224, -1197.0154, 53.9095),},
                {coord = vector3(2574.1316, -1206.5809, 53.9078),},
            },
            playAnim = function()
                TaskStartScenarioInPlace(PlayerPedId(), joaat("WORLD_HUMAN_BROOM_WORKING"), 10, true, false, false, false)
            end,
            endAnim = function()
                ClearPedTasks(PlayerPedId())
                Wait(3500)
                Citizen.InvokeNative(0xFCCC886EDE3C63EC, PlayerPedId(), false, true)
            end,
            whenPlayerClose = function(coord) -- Client side function what to do when player close to task location
                local onScreen, _x, _y = GetScreenCoordFromWorldCoord(coord.x, coord.y, coord.z)
                if onScreen then
                    SetTextScale(0.35, 0.35) -- Adjust scale for readability
                    SetTextFontForCurrentCommand(1) -- Default font, adjust as needed
                    SetTextColor(255, 255, 255, 215) -- White text
                    SetTextCentre(1) -- Center the text
                    DisplayText(CreateVarString(10, "LITERAL_STRING", "[G] to clean"), _x, _y)
                end
            end,
            drawMarker = function(coord) -- Client side function to draw marker, Delete code inside if not wanted
                DrawMarker(0x94FDAE17, coord.x, coord.y, coord.z-0.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, true, 2, nil, nil, nil, false)
            end,
            rubbishProp = "new_p_litternbx02x_static", -- Optional: Redm p_cs_sackcorn01x | Fivem proc_litter_01
        },
    }
end

Language = {
    general = {
        warnedBy = "Warned by %s",
    },
    success = {
        ban = "Player banned successfully!",
        unban = "Player unbanned successfully!",
        kick = "Player kicked successfully!",
        coms = "Player given Community Service successfully!",
        warn = "Player warned successfully!",
        endcoms = "Community Service ended successfully!",
    },
    error = {
        unban = "Failed to unban player!",
        invalidBanId = "Invalid ban id!",
        alreadyComs = "Player is already serving!",
        invalidComsId = "Invalid comserve id!",
    }
}