Setup
AI EMS Setup Instructions
Configuration
Add the script to your server config
Open the config.lua
file and make any necessary adjustments.
Make sure to update the framework / script configuration section with the relevant scripts that you use.
Framework Implementations
External script implementations are handled in the framework.lua
file. This file provides the necessary functions and hooks to integrate with different frameworks and scripts.
Out of the box, the script includes implementations for:
Framework
Notify
Ambulance / Hospital
Fuel
If you are using a different framework or script, you will need to add the relevant implementations in the framework.lua
file.
If you are using QBCore + qb-ambulancejob, be sure to implement the custom checkin function
Setup Hospital Locations
Configure the HospitalLocations to align with the hospital locations you are using.
These are defined in the Config under GenerateHospitalLocations
.
Dispatch AI EMS
Setup the various ways you want the AI EMS to be dispatched to the downed player.
Example Usage
Dispatch AI EMS when player presses a button when they are dead
Dispatch AI EMS automatically when player dies
Add a command for EMS/Police job to send an AI EMS to the target id
In your dispatch app, add a button that lets you send an AI EMS to the downed player via the downed player alerts.
In some cases you may want the EMS dispatched immediately, like when a EMS/police player triggers it to go to a downed person, on the other hand you may want to make it delayed when the person presses a button while dead.
Command
/callems
Enable/Disable command with: Config.EnableCallEMSCommand
Configure whether the command will dispatch immediately or with a delay with Config.IsEMSCommandInstantDispatch
.
Rename the command in the server.lua
file.
Client Event
Server Event
Additional Notes
It is not 100% guaranteed that the AI EMS will be able to reach the downed players location. There are several factors that contribute to reducing the reliability.
AI navigation is far from perfect. There are plenty of variables and obstacles that can result in the AI not reaching a player including but not limited to: downed player location, traffic, other players, etc.
The AI EMS tends to have the most difficulties / fail, when the downed person is far away from the road, in tight alleyways, on roof tops, or other hard to reach areas. The success rate, is highly dependent on the location that the AI EMS is dispatched to. It is most successful when the downed person is in an open, accessible area near a road.
Custom MLOs are a known problematic area. Often this is due to MLOs not properly setting up a navmesh, which is required for the AI to properly pathfind its way in the world. This often results in the AI EMS not being able to enter or navigate interiors of these MLOS. This is not something that this script can solve.
If you have an interior with improper navmesh, it is recommended to have players bring the downed player outside of the building first and then trigger the dispatch AI EMS.
Last updated