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.md

You 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.md

Before starting the resource, open:

config.lua

This 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_01

You 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:

Ambulance

You 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 = 10000

The value is measured in milliseconds.

#Examples

5 seconds

Config.ReviveDelay = 5000

10 seconds

Config.ReviveDelay = 10000

15 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 = 500

This means the player will be charged:

$500

To change the price:

Config.Fee = 1000

The 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 = 5

For example, with:

Config.MaxEMSOnline = 5

AI 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 = 2

This 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.cfg

Add:

ensure CES_AI_Medic

For example:

ensure qb-core
ensure CES_AI_Medic

If 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_Medic

If the resource is already running, use:

restart CES_AI_Medic

You should see CES AI Medic start without any errors.


#Step 12 β€” Test CES AI Medic

Join your FiveM server and test the system.

Use:

/callmedic

The AI medic should:

  1. Receive the request.
  2. Spawn the ambulance.
  3. Spawn the AI medic.
  4. Drive toward the player.
  5. Exit the ambulance.
  6. Walk toward the player.
  7. Begin treatment.
  8. Perform the treatment animation.
  9. Revive the player.
  10. Transport the player to the nearest hospital.
  11. Clean up the AI medic and ambulance.

#Using /callmedic

Players can request an AI medic with:

/callmedic

This 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: pistol

This 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_Medic

QBCore 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:

  1. CES AI Medic is running.
  2. ensure CES_AI_Medic is in server.cfg.
  3. The player is downed or dead.
  4. There are no errors in the server console.
  5. 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.lua

Your 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-core

is running correctly.

Also check:

Config.Fee = 500

Remember that standalone mode does not charge the EMS fee.


#AI EMS Will Not Respond

If you are using QBCore, check:

Config.MaxEMSOnline = 5

The 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.lua

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)
}

Make sure the coordinates are valid locations on your map.


#Testing Checklist

Before putting CES AI Medic into production, test:

  • [ ] Resource starts without errors
  • [ ] /callmedic works
  • [ ] 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:

  1. Stop the CES AI Medic resource.
  2. Back up your current config.lua.
  3. Back up any custom files you have modified.
  4. Remove the old resource files.
  5. Upload the new version.
  6. Restore your configuration.
  7. Review the new version's configuration options.
  8. Start the resource.
  9. 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

https://crazyeyesstudio.com/


#Β© Crazy Eyes Studio

CES AI Medic is a product of Crazy Eyes Studio.

All rights reserved.

No ratings yet