CES Help Document > FiveM > Advanced AI Medic

Advanced AI Medic

# CES AI Medic

A lightweight, standalone + QBCore-compatible AI EMS solution that revives players and transports them to the nearest hospital if no real EMS are available.


📜 Command Usage

CommandDescriptionFramework
/callmedicCalls AI EMS to revive the playerAll


⚙️ Configuration Options (config.lua)

Config.MedicModel = 's_m_m_paramedic_01'     -- Medic ped model
Config.AmbulanceModel = 'Ambulance'          -- Vehicle model used
Config.ReviveDelay = 10000                   -- Time (ms) medic will "treat" the player
Config.Fee = 500                              -- Bank fee charged for EMS
Config.MaxEMSOnline = 5                       -- AI EMS only triggers below this threshold

-- Hospital drop-off points
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)
}


🔩 How It Works

  1. Player types /callmedic
  2. If less than Config.MaxEMSOnline EMS are on duty, AI medic responds.
  3. An ambulance spawns and drives to the player.
  4. Medic revives the player using an animation and a med bag prop.
  5. Player is charged (bank) and taken to the nearest hospital.
  6. Medic and ambulance despawn.

❗ In standalone mode, QBCore logic is skipped. All messages and charges are simulated.


💬 Notifications

"AI EMS is on the way!"

"You were charged $500 for EMS service."

"Died from: weapon name" (floating 3D text)

"You have been revived by AI EMS."


🧰 Dependencies

✅ QBCore (auto-detects)

❌ No external dependencies for standalone


🛠 Troubleshooting

Not reviving?

Ensure qb-core is started before this script

Check that EMS online count is below Config.MaxEMSOnline

Verify your client.lua shows the console log: QBCore detected and initialized

Want to change the revive animation or model?

Modify Config.MedicModel, Config.ReviveDelay, or the animation dictionary

Error: Could not get your location.

* Caused when ped coords can't be retrieved from GetEntityCoords


✅ Setup Instructions

  1. Drag folder into your resources directory.
  2. Add to your server.cfg:

   ensure ces_aimedic
   

3. Edit config.lua as needed.

4. Restart your server.


Need more help? Join the support Discord


Suggest an edit

Review this page

crazyeyes29