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 Five Emergency Core (fe-core) using keymaster. Download Five Emergency Assets (fe-assets) using keymaster.
Download the Dependencies
Download the latest oxmysql GitHub
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.
ScaleformUI_Lua
Delete the example.lua file from the ScaleformUI_Lua folder
example.lua <-- delete this
fxmanifest.lua
ScaleformUI.luaImport 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
ensure ScaleformUI_Lua
ensure ScaleformUI_Assets
ensure loaf_headshot
ensure ox_lib
ensure rpemotes-reborn
ensure fe-assets
ensure fe-core
ensure fe-calloutsMake sure that all dependencies are installed before starting the server.
Configuration
Ace Permission Setup
Five Emergency uses ace permissions to control access to certain features. Assign these permissions to users or groups in your server.cfg as needed.
Available Ace Permissions
| Permission | Description |
|---|---|
FiveEmergency.Admin | Grants full administrative access, including creating and managing departments and bypasses all permission restrictions. |
FiveEmergency.Duty | Allows toggling duty status using the /duty command without being near a duty point. |
Example Usage
## Five Emergency Ace Permissions
add_ace group.admin "FiveEmergency.Admin" allow
add_ace group.admin "FiveEmergency.Duty" allowArmory
Open the armory.lua file, which you can find in the fe-core/config directory.
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
Item = 'WEAPON_COMBATPISTOL', -- Itemname or Weaponname (depending on the framework).
Amount = 250, -- Number of items or ammo (depending on the framework).
Type = 'weapon', -- Type of item
Animation = 'pistol' -- Animation category
},
{
Ranks = { 'Officer I', 'Officer II' },
Label = 'Carbine Rifle',
Item = 'WEAPON_CARBINERIFLE',
Amount = 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.
Bodycam & Dashcam
Officers can toggle their bodycam using the /bodycam command. Recordings from the bodycam can be uploaded directly to Fivemanage. To enable bodycam recording and integration, make sure to fill in the required API key in your settings.lua file.
The bodycam is automatically disabled when specifying an inventory item.
All fleet vehicles are equipped with an integrated dashcam by default. If you want to integrate a dashcam into a non-fleet vehicle from another script, use the following export:
exports['fe-core']:registerVehicleDashcam(vehicleNetworkId, {
departmentId = department.id
})Replace vehicleNetworkId with the network ID of the vehicle and set the appropriate Department ID.
Dispatches
Five Emergency features a dispatch system that allows employees to join as dispatchers and manage emergency calls for their department. Dispatchers require a specific permission to join as a dispatcher. Each department receives dispatches automatically at intervals defined in config/dispatches.lua.
Dispatch Configuration
Open the dispatches.lua file, which you can find in the fe-core/config directory.
DispatchConfig = {
AutomaticGeneration = {
Enabled = true,
MinIntervalMinutes = 5,
MaxIntervalMinutes = 10,
},
AutoCleanup = {
Enabled = true,
UnassignedTimeoutMinutes = 5
},
}AutomaticGeneration: Controls whether dispatches are generated automatically and sets the minimum and maximum interval (in minutes) between dispatches for each department.
AutoCleanup: Automatically removes unassigned dispatches after the specified timeout (in minutes).
Exports
Developers can create custom 911 callouts using the provided export Create911Call with the following fields:
message(string, max 50 characters): The emergency message.name(string, max 30 characters): The caller's name.streetName(string, optional): The street name for the call location.zoneName(string, optional): The zone name for the call location.
Duty
Open the duty.lua file, which you can find in the fe-core/config directory.
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.
GarageConfig = {
{
pedHash = 'ig_trafficwarden',
blip = {
enabled = true,
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(457.9114, -1017.4764, 28.2777, 85.4488),
preview = vector4(405.13, -957.99, -99.54, 156.02),
spawns = {
vector4(446.0407, -1025.3114, 28.7758, 7.757),
vector4(442.2809, -1025.9348, 28.7775, 5.2337)
}
},
vehicles = {
{ label = 'Police Cruiser 1', model = 'police', useRanks = false, departments = { ['LSPD'] = { 'Officer 1' } } },
{ label = 'Police Cruiser 2', model = 'police2', useRanks = false, departments = { ['LSPD'] = { 'Officer 2' } } },
}
},
}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.
General
Open the general.lua file, which you can find in the fe-core/config directory.
This section contains all general configuration settings for the script. Here you can adjust key bindings, language, framework type, and connected resources. You can also configure commands, callout behavior, Discord presence, menu banners, and AI services like ambulance or tow truck. Additionally, it includes settings for the scene menu, panic button, prison drop-off, and drug effects.
GeneralConfig = {}
GeneralConfig.MDT = {
Key = 'F3',
Language = 'en',
Framework = 'standalone', -- 'standalone', 'ndcore', 'qbcore', 'esx', 'ox'
Inventory = '', -- '', 'qb', 'ox', 'qs'
Interaction = '', -- '', 'oxtarget'
DateFormat = 'dd.MM.yyyy HH:mm',
EmployeeInactiveDays = 30,
}
GeneralConfig.Commands = {
fdv = { Enabled = true },
fdp = { Enabled = true },
fdo = { Enabled = true },
duty = { Enabled = true }
}
GeneralConfig.Integrations = {
Target = {
Enabled = false,
Resource = 'ox_target' -- 'ox_target'
}
}
GeneralConfig.Resources = {
NearestPostal = 'NearestPostal',
}
GeneralConfig.DiscordPresence = {
Enabled = true,
ApplicationId = '1392901067943182538',
BigAsset = { AssetName = 'fe-big', AssetText = 'Five Emergency' },
SmallAsset = { AssetName = '', AssetText = '' },
Buttons = {
{ Label = 'Discord', URL = 'https://discord.gg/5emergency' }
}
}
GeneralConfig.MenuSettings = {
ArmoryMenu = { hasBanner = true, banner = 'https://i.ibb.co/4Z2hBfZM/armory.png' },
DutyMenu = { hasBanner = true, banner = 'https://i.ibb.co/PszVSS9T/duty.png' },
GarageMenu = { hasBanner = true, banner = 'https://i.ibb.co/G45DQVgM/garage.png' },
LockerMenu = { hasBanner = true, banner = 'https://i.ibb.co/4ZfrqJy3/banner3.png' },
PedInteractionMenu = { hasBanner = true, banner = 'https://i.ibb.co/LhNXTBLZ/eup-ped.png' },
SpeedZoneMenu = { hasBanner = true, banner = 'https://i.ibb.co/Lzg61Yzg/speedzone.png' },
TrunkMenu = { hasBanner = true, banner = 'https://i.ibb.co/wk1WmTs/trunk.webp' },
EquipmentSelectionMenu = { hasBanner = true, banner = 'https://i.ibb.co/wNJcTqdT/equipment.webp' },
}
GeneralConfig.NotificationSystem = 'scaleformui' -- 'scaleformui', 'ed_notify', 'ox_lib'
GeneralConfig.Emergency = {
Enabled = true,
Command = '911'
}
GeneralConfig.SceneMenu = {
Key = 'F10',
RangeLimit = 125,
SpeedLimit = 120
}
GeneralConfig.OnboardComputer = {
Key = 'PAGEUP',
Command = 'opentablet'
}
GeneralConfig.Tackle = {
Enabled = true,
Keys = {
Primary = 21, -- LEFT SHIFT
Secondary = 38 -- E
},
Cooldown = 5000
}
GeneralConfig.Panic = {
Enabled = true,
Command = 'panic',
WaypointKey = 'Y',
MapDisplay = true,
PanicCooldown = 60,
BlipCooldown = 120
}
GeneralConfig.PrisonDropOff = {
Locations = { vector3(1690.91, 2604.96, 45.17) },
Marker = { Type = 1, Scale = vector3(5.0, 5.0, 2.0), Color = { r = 255, g = 255, b = 255, a = 100 } }
}
GeneralConfig.Drugs = {
Marijuana = { clipSet = 'move_f@depressed@c', probability = 0.2 },
Cocaine = { clipSet = 'move_m@swagger@b', probability = 0.2 },
Heroin = { clipSet = 'move_m@buzzed', probability = 0.2 },
Methamphetamine = { clipSet = 'move_m@buzzed', probability = 0.2 },
Ecstasy = { clipSet = 'move_m@swagger@b', probability = 0.2 }
}Locker
Open the outfits.json file, which you can find in the fe-core/config/data directory.
[
{
"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.
Services
Five Emergency supports AI services such as ambulance, coroner, mechanic, tow truck and prisoner transport. You can configure these services in the services.lua file found in the fe-core/config directory.
Services can use either freemode peds (customizable) or scenario peds (standard NPC models). For freemode peds, you can specify clothing options using the Drawables and Props fields to customize their appearance.
ServiceConfig = {
Menu = {
Enabled = true,
Key = 'G',
Command = 'servicemenu',
},
-- Services
Ambulance = {
Ped = {
Type = 'ped', -- 'freemode', 'ped'
Model = 's_m_m_paramedic_01',
Drawables = {
[3] = 15,
},
Props = {}
},
Vehicle = 'ambulance',
DrivingStyle = 524604,
ReviveChance = 50,
TravelDistance = 100.0
},
Coroner = {
Ped = {
Type = 'ped', -- 'freemode', 'ped'
Model = 's_m_m_doctor_01',
Drawables = {
[3] = 15,
},
Props = {}
},
Vehicle = 'speedo',
DrivingStyle = 786603,
TravelDistance = 100.0
},
Mechanic = {
Ped = {
Type = 'ped', -- 'freemode', 'ped'
Model = 's_m_m_autoshop_02',
Drawables = {
[3] = 15,
},
Props = {}
},
Vehicle = 'UtilliTruck3',
RepairVisualDamage = true,
DrivingStyle = 786603,
TravelDistance = 100.0
},
Towtruck = {
Ped = {
Type = 'ped', -- 'freemode', 'ped'
Model = 's_m_m_trucker_01',
Drawables = {
[3] = 15,
},
Props = {}
},
Vehicle = 'flatbed',
DrivingStyle = 786603,
TravelDistance = 100.0
},
Transport = {
Ped = {
Type = 'ped', -- 'freemode', 'ped'
Model = 's_m_y_cop_01',
Drawables = {
[3] = 15,
},
Props = {}
},
Vehicle = 'policet',
DrivingStyle = 786603,
TravelDistance = 100.0
},
}Exports
Five Emergency provides an export function RequestService that allows developers to request AI services from their own resources.
Available Services:
| Service | Description |
|---|---|
towtruck | Requests a tow truck |
mechanic | Requests a mechanic |
ambulance | Requests an ambulance |
coroner | Requests a coroner |
transport | Requests prisoner transport |
Example:
-- Request a tow truck service
exports['fe-core']:RequestService('towtruck')
-- Request an ambulance
exports['fe-core']:RequestService('ambulance')Settings
Open the settings.lua file, which you can find in the fe-core/config directory.
Development Settings
Settings.Development enables development features, such as automatically going on duty when joining the server. Set this to true only for testing or development environments.
Discord Integration
You can configure different Discord integrations for each department. This is optional and allows each department to have its own Discord guild, bot token, nickname change setting and allowed roles.
To do this, add entries inside the Departments table in your settings:
If a department is not listed, it will use the global Discord settings.
Whitelisted Domains
Settings.WhitelistedDomains defines which domains are allowed for external links (currently used for ranks, divisions and avatars). Only links from these domains are allowed. For local images (starting with nui://), no whitelist is required.
Settings = {}
-- Enable development settings (currently only used for going on-duty automatically)
Settings.Development = false
Settings.Discord = {
Enabled = false,
Global = {
GuildId = '',
BotToken = '',
NicknameChange = true,
AllowedRoles = {}
},
Departments = {
LSPD = {
GuildId = 'YOUR_LSPD_GUILD_ID',
BotToken = 'YOUR_LSPD_BOT_TOKEN',
NicknameChange = true,
AllowedRoles = { '1234567890', '0987654321' }
},
-- Add more departments as needed
}
}
Settings.WhitelistedDomains = {
'imgur.com',
'cdn.discordapp.com',
'media.discordapp.net',
'ibb.co',
'i.ibb.co'
}Trunk
Open the trunk.lua file, which you can find in the fe-core/config directory.
This configuration controls the trunk system for vehicles in Five Emergency. Adjust weights, categories, equipment, props, and pickup settings.
Item Types
- weapon: Standalone GTA weapons (e.g.,
WEAPON_PISTOL) - item: Inventory items (ox, qb, qs, etc.)
- armor: Standalone armor (Bulletproof vest)
- heal: Standalone healing item (First aid kit)
- spikestrips: Equip and place spike strips
- policetape: Equip and place police tape
TrunkConfig = {
GlobalTrunkMaxWeight = 50.0,
VehicleTrunkMaxWeights = {
['police'] = 50.0,
['police2'] = 50.0,
},
EquipmentBagMaxWeight = 15.0,
EquipmentPickup = {
Locations = {
vector3(456.75, -988.64, 30.69)
},
Marker = {
Enabled = true,
Type = 23,
Scale = vector3(0.9, 0.9, 2.0),
Color = { R = 255, G = 255, B = 255, A = 255 }
}
},
Categories = {
['Weapons'] = 'Weapons'
},
Equipment = {
{
Type = 'weapon',
Title = 'Pistol',
Item = 'WEAPON_PISTOL',
Weight = 1.0,
Ammo = 24,
Category = 'Weapons'
},
{
Type = 'weapon',
Title = 'Taser',
Item = 'WEAPON_STUNGUN',
Weight = 0.5
},
{
Type = 'armor',
Title = 'Bulletproof Vest',
Weight = 5.0
},
{
Type = 'heal',
Title = 'First Aid Kit',
Weight = 1.0
},
{
Type = 'spikestrips',
Title = 'Spike Strips',
SubTitle = '',
Weight = 5.0,
},
{
Type = 'policetape',
Title = 'Police Tape Roll',
SubTitle = '',
Weight = 0.3,
}
},
Props = {
['Barriers'] = {
{
Title = 'Small Traffic Cone',
Item = 'prop_roadcone02a',
MaxPickup = 3,
StopPeds = true,
Pickup = {
Enabled = true,
AnimDict = 'missfbi4prepp1',
AnimName = '_idle_garbage_man',
Position = vector3(0.03, 0.05, -0.28),
Rotation = vector3(0, 0, 0)
}
},
{
Title = 'Large Traffic Cone',
Item = 'prop_roadcone01a',
StopPeds = true
},
{
Title = 'Police Barrier',
Item = 'prop_barrier_work05',
MaxPickup = 3,
StopPeds = true,
Weight = 2.0,
Pickup = {
Enabled = true,
AnimDict = 'anim@heists@box_carry@',
AnimName = 'idle',
Position = vector3(0, -0.11, -1.02),
Rotation = vector3(0, 0, 0)
}
},
{
Title = 'Small Barrier',
Item = 'prop_barrier_work01c',
StopPeds = true
},
{
Title = 'Small Barrier (Light)',
Item = 'prop_barrier_work02a',
StopPeds = true
},
{
Title = 'Large Barrier',
Item = 'prop_barrier_work06a',
StopPeds = true
},
{
Title = "Barrier 'Street Closed",
Item = 'prop_barrier_work04a',
StopPeds = true
},
{
Title = "Barrier 'Slow",
Item = 'prop_barrier_sign_30',
StopPeds = false
},
{
Title = "Barrier 'Stop",
Item = 'prop_barrier_sign_stop',
StopPeds = false
}
},
['Traffic Signs'] = {
{
Title = 'Sign (25mph)',
Item = 'prop_sign_road_06d',
StopPeds = false
},
{
Title = 'Sign (35mph)',
Item = 'prop_sign_road_06e',
StopPeds = false
},
{
Title = 'Fire Activity Ahead',
Item = 'prop_barrier_sign_16',
StopPeds = false
}
},
['Lighting'] = {
{
Title = 'Large Work Light',
Item = 'prop_worklight_03b',
StopPeds = false
},
{
Title = 'Small Work Light',
Item = 'prop_worklight_04d',
StopPeds = false
}
},
['Medical'] = {
{
Title = 'Medical Bag',
Item = 'xm_prop_x17_bag_med_01a',
StopPeds = false
},
{
Title = 'ECG',
Item = 'prop_ld_case_01',
StopPeds = false
},
{
Title = 'Field Bed',
Item = 'gr_prop_gr_campbed_01',
StopPeds = false
},
{
Title = 'Evidence Marker',
Item = 'ch_prop_ch_fib_01a',
StopPeds = false
}
},
['Miscellaneous'] = {
{
Title = 'Tent',
Item = 'prop_gazebo_02',
StopPeds = false
},
{
Title = 'Chair',
Item = 'v_ilev_leath_chr',
StopPeds = false
},
{
Title = 'Target Black',
Item = 'gr_prop_gr_target_04a',
StopPeds = false
}
}
},
ObjectBlip = {
Enabled = true,
Name = 'Object',
Sprite = 128,
Color = 0,
Scale = 0.9
},
ObjectPickupAnimation = {
Dict = 'random@domestic',
Name = 'pickup_low'
},
PickupableProps = {
[-874338148] = true
}
}Guides
Using Local Images
Instead of using external links (e.g. ranks or division icons), you can upload images locally. To do this, follow these steps:
- Place your images inside the
fe-assets/filesdirectory. You can organize images in subfolders as needed (e.g.fe-assets/files/images/icons/ranks/sergeant.png). - After adding or changing images or folders, restart the
fe-assetsresource to apply the changes.
Example:
- Image path:
fe-assets/files/images/icons/ranks/sergeant.png - Image URL:
nui://fe-assets/files/images/icons/ranks/sergeant.png
Instead of using an http(s) link for the icon, you’ll use the Image URL (starting with nui://) as shown above.
You can create as many subfolders as needed to organize your assets.