ylean_aiparamedic
AI Paramedic - Documentation
AI Paramedic is a script for FiveM that allows players to call an AI-controlled paramedic. The paramedic will arrive by car, helicopter, or boat depending on the player's location. Based on the rescue mode, the paramedic can either resuscitate the player on the spot or transport them to the hospital for surgery or further care.
Table of Contents
Introduction
Features
Requirements
Installation
Configuration
Config File
Configuration Options
Usage
Commands
Rescue Modes
Translations
Frequently Asked Questions (FAQ)
Support
Introduction
AI Paramedic is an advanced script for FiveM servers that enhances gameplay by introducing AI paramedics who respond to players in critical conditions. Players can call for help, and the AI paramedic will react appropriately, adapting to the situation and location.
Features
Intelligent Response: The paramedic arrives using the appropriate mode of transportation (car, helicopter, boat) based on the player's location.
Rescue Modes: Two rescue modes are available—normal (on-spot resuscitation) and advanced (transport to hospital).
Highly Configurable: Extensive configuration options to tailor the script to your server's needs.
No Dependencies: The script does not require any external dependencies or database access.
Framework Support: Compatible with both QBCore and ESX frameworks.
Requirements
FiveM Server: Latest version of the FiveM server.
Framework: QBCore or ESX (depending on the script version).
Installation
Download the Script: Obtain the latest version of the AI Paramedic script.
Optionally: download the props and helicopter vehicle included with the script.
Place in
resources
Folder: Copy the script folder into your server'sresources
directory.Add to
server.cfg
: Include the lineensure ai-paramedic
(replace with the script folder's name if different) in yourserver.cfg
file.Restart Server: Restart your server to load the new script.
Configuration
Config File
The script includes a configuration file (config.lua
) that allows you to customize its behavior. Ensure you edit the correct file for your framework (QBCore or ESX).
Configuration Options
Below is a description of the available configuration options.
Basic Settings
Ylean.Framework
: Specifies the framework used (for qbcore).Ylean.Locales
: Script language. Default is"en"
. You can add your own translations.Ylean.ReviveEvent
: The event responsible for reviving the player.For QBCore:
"hospital:client:Revive"
For ESX:
"esx_ambulancejob:revive"
Ylean.Debug
: If set totrue
, debug information will be displayed in the console.Ylean.MedicsOnline
: The maximum number of medics online allowed before AI paramedics cannot be called.Ylean.CanDrownBeRescued
: Allows rescue after drowning (via boat) if set totrue
.Ylean.AllowRemoteRescue
: Allows rescue in remote locations (via helicopter) if set totrue
.Ylean.NotifyViaChat
: Iftrue
, notifications are sent via chat; otherwise, they use system notifications.Ylean.WhitelistedJobs
: List of jobs that can call for help for free, regardless of the number of medics online.
Rescue Mode
Ylean.RescueMode
: Sets the rescue mode. Available options:"normal"
: The player is revived on the spot."advanced"
: The paramedic examines the player; if injuries are severe, the player is transported to the hospital.
Calling the Ambulance
Ylean.CallAmbulance.Price
: Fee for calling the ambulance.Ylean.CallAmbulance.WayOfPayment
: Payment method ("cash"
/"money"
or"bank"
).Ylean.CallAmbulance.Cooldown
: Time (in seconds) before the ambulance can be called again.Ylean.CallAmbulance.NotifyAfterCooldownEnds
: Notify the player when the cooldown ends if set totrue
.Ylean.CallAmbulance.CanMove
: If set tofalse
, moving will cancel the rescue process.Ylean.CallAmbulance.Command.UseCommand
: Enable or disable the use of a command to call for help.Ylean.CallAmbulance.Command.CommandName
: The name of the command used to call for help.
Normal Rescue Configuration
Ylean.NormalRescueConfig.AED
: Settings related to the Automated External Defibrillator used by the paramedic.Ylean.NormalRescueConfig.Time
: Time (in milliseconds) spent performing CPR before reviving the player.
Advanced Rescue Configuration
Ylean.AdvancedRescueConfig.MedicBag
: Settings for the medic's bag.Ylean.AdvancedRescueConfig.ExamineTime
: Time the paramedic spends examining the player.Ylean.AdvancedRescueConfig.DeathCause
: Specifies death causes that require transport to the hospital.Ylean.AdvancedRescueConfig.DrivingStyle
: Driving style of the paramedic during transport.Ylean.AdvancedRescueConfig.Modes
: Settings for patient transport modes.
Medical Vehicles
Ambulance:
Ylean.Ambulance.Model
: Model of the ambulance vehicle.Ylean.Ambulance.Paramedic
: Model of the paramedic ped.Ylean.Ambulance.SpawnRadius
: Radius within which the ambulance spawns.Ylean.Ambulance.Stretcher
: Settings for the stretcher.Ylean.Ambulance.drivingStyle
: Driving style of the ambulance.
Air Ambulance (Helicopter):
Ylean.AirAmbulance.Model
: Model of the air ambulance.Ylean.AirAmbulance.Paramedic
: Model of the paramedic ped.Ylean.AirAmbulance.SpawnRadius
: Radius within which the helicopter spawns.Ylean.AirAmbulance.LandingSpot
: Where the helicopter lands with the injured player.Ylean.AirAmbulance.Entrance
: Where the medic takes the player after landing.Ylean.AirAmbulance.WinchHeight
: Altitude from which the helicopter can use a winch.Ylean.AirAmbulance.WinchingDuration
: Time taken to hoist the player into the helicopter.
Water Ambulance (Boat):
Ylean.WaterAmbulance.Model
: Model of the emergency boat.Ylean.WaterAmbulance.Paramedic
: Model of the paramedic ped.Ylean.WaterAmbulance.SpawnRadius
: Radius within which the boat spawns.Ylean.WaterAmbulance.DrivingStyle
: Driving style of the boat.Ylean.WaterAmbulance.Speed
: Speed of the boat.Ylean.WaterAmbulance.BringLength
: Distance from which a player can be brought on board.Ylean.WaterAmbulance.BringingDuration
: Time taken to bring the player on board.Ylean.WaterAmbulance.Stretcher
: Settings for the stretcher on the boat.
Additional Settings
Ylean.Beds
: Coordinates of hospital beds where players wake up after surgery, along with their models.Ylean.VideoLength
: Length of before and after surgery scenes (update these if you change the scenes).
Usage
Commands
Call for Help: Players can call the paramedic using the command
/callambulance
, providedUseCommand
is set totrue
.Canceling the Call: If
CanMove
is set tofalse
, moving will cancel the rescue process.
Rescue Modes
Normal Mode:
The paramedic arrives and performs on-spot resuscitation.
Uses an AED (defibrillator).
Resuscitation time is set in
NormalRescueConfig.Time
.
Advanced Mode:
The paramedic examines the player for a set time (
ExamineTime
).If injuries are severe (as per
DeathCause
), the player is transported to the hospital.Two scenarios are possible:
Transport for Surgery: The player undergoes surgery and wakes up in a hospital bed after
SurgeryTime
seconds.Transport to Hospital: The player is dropped off at the hospital without surgery.
Translations
The script supports multiple languages through localization files. Example translation file:
Adding a New Translation:
Create a new localization file, e.g.,
ru.lua
.Translate all keys into the desired language.
In the configuration file, set
Ylean.Locales = "ru"
.
Frequently Asked Questions (FAQ)
Q: Does the script require any additional resources or dependencies?
A: No, the script does not require any additional dependencies or database access.
Q: How can I add custom death causes that require hospital transport?
A: You can edit the death_causes.lua
file, adding or modifying categories and their corresponding weapon IDs.
Q: Can I customize vehicle and paramedic models?
A: Yes, you can change the models in the configuration file, such as Ylean.Ambulance.Model
or Ylean.Ambulance.Paramedic
.
Q: What happens if a player moves while waiting for the paramedic?
A: If Ylean.CallAmbulance.CanMove
is set to false
, moving will cancel the rescue process.
Q: Can I adjust the cooldown time for calling help?
A: Yes, you can modify the Ylean.CallAmbulance.Cooldown
value in the configuration file.
Support
If you encounter any issues or have questions about the script, please contact us:
Last updated