Picture of the authoredeverce

Five Emergency

Five Emergency is an advanced online police simulation for FiveM that offers a fully immersive law enforcement experience. Players take on the role of police officers and interact with a wide range of in-game systems designed to simulate real-life police duties.

Installation

Download the Script

Download the script using keymaster.

Download the Dependencies

Download the latest ox_lib GitHub.

Download the latest ScaleformUI_Lua GitHub.

Download the latest ScaleformUI_Assets GitHub.

Download the latest Loaf_Headshot GitHub.

Download the latest RPEMOTES-REBORN GitHub.

Import the database

Import the provided database file fiveemergency.sql into your database using your preferred database management tool (e.g., phpMyAdmin, HeidiSQL, or the MySQL CLI).

Server.cfg Configuration

Finally, if everything has been set up correctly, add the following lines to your server.cfg to ensure the required resources are loaded

server.cfg
ensure ScaleformUI_Lua
ensure ScaleformUI_Assets
ensure loaf_headshot
ensure ox_lib
ensure rpemotes-reborn
ensure fe-core
ensure fe-callouts

Make sure that all dependencies are installed before starting the server.

Configuration

Ace Permission Setup

To create departments in Five Emergency, you must grant the FiveEmergency.Admin ace permission to the appropriate users or groups. Without this permission, users will not be able to create departments. This permission will also let you manage every department.

add_ace group.admin "FiveEmergency.Admin" allow

FiveEmergency.Admin will grant full access and bypasses any permission restrictions there may be. No rank is required.

Settings

Settings = {}

-- Development mode
Settings.Development is currently only used to automatically set players on-duty when they are initialized.
No other admin/debug features are affected by this mode at this time.
Settings.Development = false

-- Discord integration settings
Settings.Discord = {
    Enabled = false,         -- Enable or disable Discord integration
    GuildId = '',            -- Discord server (guild) ID
    BotToken = '',           -- Discord bot token
    NicknameChange = false,  -- Allow the bot to change user nicknames to their employee name
    AllowedRoles = {}        -- List of Discord role IDs allowed to assign roles configured in the MDT
}

-- List of allowed image domains (used for ranks, division, bolo and other features in the future)
Settings.WhitelistedImageDomains = {
    'imgur.com',
    'cdn.discordapp.com',
    'media.discordapp.net',
    'ibb.co',
    'i.ibb.co'
}

Weapon Armory

Open the armory.lua file, which you can find in the fe-core/config directory.

fe-core/config/armory.lua
ArmoryConfig = {
    {
        Departments = { 'LSPD', 'SAHP' }, -- Departments that can access this armory (Department Shortname)
        UseRanks = true, -- Whether equipment is restricted based on rank
        PedHash = 's_m_y_cop_01', -- Ped model shown at the armory
        Blip = {
            Enabled = true, -- Show blip on the map
            Name = 'Weapon Armory', -- Blip name
            Sprite = 110, -- Blip icon sprite ID
            Scale = 0.9, -- Blip scale on the map
            Color = 3, -- Blip color ID
            Alpha = 255 -- Blip transparency
        },
        UseArmoryAnimation = true, -- Enable weapon handover animation
        Coordinates = {
            Ped = vector4(454.11, -980.26, 30.69, 90), -- Ped spawn location and heading
            Interaction = vector3(452.26, -980.0, 30.69) -- Position where the player interacts
        },
        Equipment = {
            {
                Ranks = { 'Officer I', 'Officer II' }, -- Allowed ranks
                Label = 'Combat Pistol', -- Display name in menu
                Hash = 'WEAPON_COMBATPISTOL', -- Weapon hash
                Ammo = 250, -- Ammo amount given
                Type = 'weapon', -- Type of item
                Animation = 'pistol' -- Animation category
            },
            {
                Ranks = { 'Officer I', 'Officer II' },
                Label = 'Carbine Rifle',
                Hash = 'WEAPON_CARBINERIFLE',
                Ammo = 250,
                Components = {
                    'COMPONENT_AT_AR_SUPP' -- Weapon attachments (e.g., suppressor)
                },
                Type = 'weapon',
                Animation = 'rifle'
            },
            {
                Ranks = { 'Officer I', 'Officer II' },
                Label = 'Armor', -- Bulletproof vest
                Type = 'armor'
            },
            {
                Ranks = { 'Officer I', 'Officer II' },
                Label = 'Ammobox', -- Extra ammunition
                Type = 'ammo'
            },
            {
                Ranks = { 'Officer I', 'Officer II' },
                Label = 'First-Aid-Kit', -- Healing item
                Type = 'heal'
            },
        }
    }
}

To ensure weapon animations work perfectly, make sure the corresponding animation positions match exactly – especially the distance between player and npc must be aligned.

Make sure that all ranks and department shortname names used here already exist and are configured in the MDT. Otherwise, access may not work as expected.

Locker

Open the outfits.json file, which you can find in the fe-core/config/data directory.

fe-core/config/data/outfits.json
[
  {
    "Name": "Male LSPD Uniform A",
    "Gender": "Male", // "Male" or "Female"
    "Category": "EUP",
    "Category2": "Los Santos Police Department", // Department name required to see this uniform
    "Hat": "0:0",
    "Glasses": "0:0",
    "Ear": "0:0",
    "Watch": "0:0",
    "Mask": "11:1",
    "Top": "32:1",
    "UpperSkin": "5:1",
    "Decal": "9:1",
    "UnderCoat": "46:1",
    "Pants": "21:1",
    "Shoes": "22:1",
    "Accessories": "5:1",
    "Armor": "0:0",
    "Parachute": "10:1"
  }
]

Uniforms will only be visible to departments listed under Category2. Make sure to enter the exact department name as defined in your MDT.

Duty

Open the duty.lua file, which you can find in the fe-core/config directory.

fe-core/config/duty.lua
DutyConfig = {
    Key = 'E',
    Locations = {
        vector3(433.3412, -981.1572, 31.02518), -- First Duty point
		vector3(261.6609, -316.0813, 44.64938), -- Second Duty point
    },
    Marker = {
        Enabled = true,
        Type = 23,
        Scale = vector3(0.9, 0.9, 2.0),
        Color = { R = 255, G = 255, B = 255, A = 255 }
    },
    Blip = {
        Enabled = true,
        Name = 'Duty',
        Sprite = 606,
        Scale = 0.9,
        Color = 3,
        Alpha = 255
    },
}

Garage

Open the garage.lua file, which you can find in the fe-core/config directory.

fe-core/config/garage.lua
GarageConfig = {
    {
        pedHash = 'ig_trafficwarden',
        blip = {
            enabled = false,
            name = 'LSPD Garage',
            sprite = 357,
            scale = 0.9,
            color = 3,
            alpha = 255
        },
        pedAnimation = { enabled = true, dict = 'amb@world_human_hang_out_street@male_c@base', name = 'base' },
        coordinates = {
            interaction = vector4(446.8088, -985.8568, 21.55864, 192.6391),
            preview = vector4(416.3311, -1005.949, 20.94171, 234.4311),
            spawns = {
                vector4(443.9808, -996.7505, 20.94183, 91.31942),
            }
        },
        vehicles = {
			   { label = 'Vapid Stanier Police', model = 'police', useRanks = false, departments = { ['LSPD'] = { '' } } },
            { label = 'Bravadoo Buffalo Police', model = 'police2', useRanks = true, departments = { ['LSPD'] = { 'Officer I' } } },
        }
    },
}

Make sure that all ranks and department shortname names used here already exist and are configured in the MDT. Otherwise, access may not work as expected.