CES AI Medic
#CES AI Medic
#Installation & Setup Guide
CES AI Medic is an autonomous EMS system for FiveM servers.
When EMS is unavailable, players can use /callmedic to request an AI medic. The medic will arrive in an ambulance, treat the player, revive them, and transport them to the nearest configured hospital.
CES AI Medic supports:
- QBCore
- Standalone FiveM servers
- AI EMS response
- AI ambulance
- Player revival
- Hospital transportation
- Configurable EMS fees
- Configurable treatment time
- Configurable medic models
- Configurable ambulance models
- Configurable hospital locations
#Requirements
Before installing CES AI Medic, make sure your server has:
- FiveM
- A working GTA V server
- A resource folder
- QBCore (optional)
#QBCore
QBCore is optional.
If QBCore is detected, CES AI Medic will use QBCore for:
- EMS player detection
- Bank payments
- QBCore notifications
- Player revival
If QBCore is not installed, CES AI Medic will automatically run in Standalone Mode.
#Installation
#Step 1 β Download CES AI Medic
Download the latest version of CES AI Medic from Crazy Eyes Studio.
Extract the downloaded ZIP file.
You should see a folder similar to:
CES_AI_Medic#Step 2 β Add the Resource
Upload the CES_AI_Medic folder to your FiveM resources directory.
For example:
resources/
βββ [scripts]/
βββ CES_AI_Medic/
βββ client/
β βββ client.lua
β βββ utils_client.lua
βββ server/
β βββ server.lua
β βββ utils_server.lua
βββ config.lua
βββ fxmanifest.lua
βββ README.mdYou can place CES AI Medic inside your existing script folder.
#Step 3 β Configure the Resource
Open the CES AI Medic folder you uploaded to your server.
You should see the following files:
CES_AI_Medic/
βββ client/
β βββ client.lua
β βββ utils_client.lua
βββ server/
β βββ server.lua
β βββ utils_server.lua
βββ config.lua
βββ fxmanifest.lua
βββ README.mdBefore starting the resource, open:
config.luaThis file contains the main configuration options for CES AI Medic.
#Step 4 β Configure the AI Medic
#Medic Model
The medic NPC can be changed using:
Config.MedicModel = 's_m_m_paramedic_01'The default model is:
s_m_m_paramedic_01You can replace this with another GTA V ped model.
Example:
Config.MedicModel = 's_m_m_doctor_01'#Ambulance Model
The ambulance used by the AI medic can be changed with:
Config.AmbulanceModel = 'Ambulance'The default vehicle is:
AmbulanceYou can replace this with another vehicle model if your server has one available.
Example:
Config.AmbulanceModel = 'polmav'Note: Make sure the vehicle model exists and is usable on your server.
#Step 5 β Configure the Revive Time
The amount of time the AI medic takes to treat the player can be changed with:
Config.ReviveDelay = 10000The value is measured in milliseconds.
#Examples
5 seconds
Config.ReviveDelay = 500010 seconds
Config.ReviveDelay = 1000015 seconds
Config.ReviveDelay = 15000#Step 6 β Configure the EMS Fee
CES AI Medic can charge players for using the AI EMS service.
The default price is:
Config.Fee = 500This means the player will be charged:
$500To change the price:
Config.Fee = 1000The player would then be charged:
$1,000#QBCore
When using QBCore, the fee is taken from the player's bank account.
#Standalone
The fee is not charged in standalone mode because there is no built-in economy system.
#Step 7 β Configure EMS Availability
CES AI Medic can check how many real EMS players are currently online.
The setting is:
Config.MaxEMSOnline = 5For example, with:
Config.MaxEMSOnline = 5AI EMS can be used while there are fewer than the configured number of EMS players online.
The script checks for players with the QBCore job:
ambulance#Example
If you want AI EMS to stop responding once 2 EMS players are online:
Config.MaxEMSOnline = 2This setting applies to QBCore servers.
#Step 8 β Configure Hospitals
CES AI Medic uses configured hospital locations to determine where the player should be transported.
The default configuration includes:
Config.Hospitals = {
city = vector3(308.24, -592.42, 43.28),
sandy = vector3(1828.52, 3673.22, 34.28),
paleto = vector3(-247.76, 6331.23, 32.43),
default = vector3(293.0, -582.0, 43.0)
}The script checks the player's location and selects the closest configured hospital.
#City Hospital
city = vector3(308.24, -592.42, 43.28)#Sandy Shores Hospital
sandy = vector3(1828.52, 3673.22, 34.28)#Paleto Hospital
paleto = vector3(-247.76, 6331.23, 32.43)#Default Hospital
default = vector3(293.0, -582.0, 43.0)The default hospital is used as a fallback location.
#Step 9 β Configure Your Hospitals
You can change the hospital coordinates if your server uses custom hospitals.
For example:
Config.Hospitals = {
city = vector3(308.24, -592.42, 43.28),
sandy = vector3(1828.52, 3673.22, 34.28),
paleto = vector3(-247.76, 6331.23, 32.43),
default = vector3(293.0, -582.0, 43.0)
}Replace the coordinates with the locations used by your server.
Tip: Make sure the coordinates place the player somewhere safe and accessible after being transported.
#Step 10 β Configure server.cfg
Open your FiveM server's:
server.cfgAdd:
ensure CES_AI_MedicFor example:
ensure qb-core
ensure CES_AI_MedicIf you are using QBCore, make sure QBCore starts before CES AI Medic.
#Step 11 β Start the Resource
Restart your FiveM server.
You can also start the resource from the server console:
ensure CES_AI_MedicIf the resource is already running, use:
restart CES_AI_MedicYou should see CES AI Medic start without any errors.
#Step 12 β Test CES AI Medic
Join your FiveM server and test the system.
Use:
/callmedicThe AI medic should:
- Receive the request.
- Spawn the ambulance.
- Spawn the AI medic.
- Drive toward the player.
- Exit the ambulance.
- Walk toward the player.
- Begin treatment.
- Perform the treatment animation.
- Revive the player.
- Transport the player to the nearest hospital.
- Clean up the AI medic and ambulance.
#Using /callmedic
Players can request an AI medic with:
/callmedicThis is useful when no real EMS players are available.
The AI medic will automatically respond to the player's location.
#AI Medic Blip
When an AI medic is dispatched, a map blip is created.
The blip identifies the AI medic so the player can track the incoming ambulance.
Once the medic has completed the call, the blip is removed.
#Cause of Death
CES AI Medic can display the player's cause of death while the medic is treating them.
For example:
Died from: pistolThis appears above the AI medic during treatment.
#Notifications
CES AI Medic provides notifications for important events.
For example:
AI EMS is on the way!and:
You have been revived by AI EMS.QBCore servers use QBCore notifications when available.
Standalone servers use the available FiveM notification/chat fallback.
#QBCore Setup
CES AI Medic automatically detects QBCore when it is available.
Make sure QBCore starts before CES AI Medic:
ensure qb-core
ensure CES_AI_MedicQBCore is used for features such as:
- EMS player detection
- Bank payments
- Player information
- Notifications
- Player revival
No additional QBCore configuration is required.
#Standalone Setup
CES AI Medic can also run without QBCore.
If QBCore is not detected, the resource automatically uses standalone functionality.
Standalone mode provides:
- AI EMS response
- AI ambulance
- Player treatment
- Player revival
- Hospital transportation
- FiveM notifications/chat fallback
The EMS service fee is skipped in standalone mode.
#Troubleshooting
#/callmedic Does Nothing
If /callmedic does not work, check:
- CES AI Medic is running.
ensure CES_AI_Medicis inserver.cfg.- The player is downed or dead.
- There are no errors in the server console.
- There are no errors in the F8 console.
#The Resource Will Not Start
Check your fxmanifest.lua.
Make sure these files exist:
config.lua
client/client.lua
client/utils_client.lua
server/server.lua
server/utils_server.luaYour manifest should reference:
client_scripts {
'client/client.lua',
'client/utils_client.lua'
}
server_scripts {
'server/server.lua',
'server/utils_server.lua'
}#The AI Medic Does Not Spawn
Check the configured models:
Config.MedicModel = 's_m_m_paramedic_01'
Config.AmbulanceModel = 'Ambulance'Make sure both models are valid GTA V models.
#The Ambulance Does Not Reach the Player
The ambulance uses GTA V vehicle AI to travel to the player's location.
The AI may have trouble reaching players in areas such as:
- Rooftops
- Interior locations
- Restricted areas
- Off-road locations
- Areas blocked by objects
- Custom map locations
Try testing the resource in an open outdoor area first.
#The AI Medic Does Not Revive the Player
Make sure the player is actually downed or dead.
If you are using QBCore, make sure your server's death/laststand system is compatible with the resource.
Also check the F8 console for errors.
#The Player Is Not Charged
If you are using QBCore, make sure:
qb-coreis running correctly.
Also check:
Config.Fee = 500Remember that standalone mode does not charge the EMS fee.
#AI EMS Will Not Respond
If you are using QBCore, check:
Config.MaxEMSOnline = 5The AI medic may not respond when the configured EMS limit has been reached.
Also make sure your EMS players have the correct QBCore job:
ambulance#Hospital Transportation Is Not Working
Check the hospital coordinates in:
config.luaExample:
Config.Hospitals = {
city = vector3(308.24, -592.42, 43.28),
sandy = vector3(1828.52, 3673.22, 34.28),
paleto = vector3(-247.76, 6331.23, 32.43),
default = vector3(293.0, -582.0, 43.0)
}Make sure the coordinates are valid locations on your map.
#Testing Checklist
Before putting CES AI Medic into production, test:
- [ ] Resource starts without errors
- [ ]
/callmedicworks - [ ] AI ambulance spawns
- [ ] AI medic spawns
- [ ] Ambulance drives to the player
- [ ] Medic reaches the player
- [ ] Treatment animation works
- [ ] Player is revived
- [ ] EMS fee works on QBCore
- [ ] EMS online check works
- [ ] Hospital transportation works
- [ ] Hospital locations are correct
- [ ] AI medic cleans itself up
- [ ] Ambulance cleans itself up
- [ ] Notifications work
- [ ] Standalone mode works if applicable
#Updating CES AI Medic
Before installing a newer version:
- Stop the CES AI Medic resource.
- Back up your current
config.lua. - Back up any custom files you have modified.
- Remove the old resource files.
- Upload the new version.
- Restore your configuration.
- Review the new version's configuration options.
- Start the resource.
- Test the system.
Important: Do not overwrite your customized configuration without making a backup first.
#Support
If you need help with CES AI Medic, contact Crazy Eyes Studio Support.
When requesting support, include:
CES AI Medic Version:
1.5.0
Framework:
QBCore / Standalone
Problem:
Describe the issue.
Error Message:
Copy the exact error message.
Steps to Reproduce:
1.
2.
3.
F8 Console Error:
Paste the error here.
Server Console Error:
Paste the error here.
Screenshots:
Attach screenshots if available.Providing the exact error message and screenshots will help us troubleshoot the issue faster.
#More CES Documentation
Visit the CES Docs website for documentation for other Crazy Eyes Studio products.
CES Docs
https://docs.crazyeyesstudio.com/
Crazy Eyes Studio
#Β© Crazy Eyes Studio
CES AI Medic is a product of Crazy Eyes Studio.
All rights reserved.
Was this article helpful?