🥤
ylean_ Docs
  • Paid releases
    • ylean_turfwars
      • QBCore DOCS
      • ESX DOCS
    • ylean_loansystem
    • ylean_hobofights
    • ylean_cryptosystem
    • ylean_armslicence
    • ylean_aiparamedic
    • ylean_loans
      • QBCORE
      • QBOX
      • ESX
  • Free releases
    • ylean_noflyzones
    • ylean_softFall
Powered by GitBook
On this page
  • AI Paramedic - Documentation
  • Table of Contents
  • Introduction
  • Features
  • Requirements
  • Installation
  • Configuration
  • Usage
  • Translations
  • Frequently Asked Questions (FAQ)
  • Support
  1. Paid releases

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

  1. Introduction

  2. Features

  3. Requirements

  4. Installation

  5. Configuration

    • Config File

    • Configuration Options

  6. Usage

    • Commands

    • Rescue Modes

  7. Translations

  8. Frequently Asked Questions (FAQ)

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

  1. Download the Script: Obtain the latest version of the AI Paramedic script.

  2. Optionally: download the props and helicopter vehicle included with the script.

  3. Place in resources Folder: Copy the script folder into your server's resources directory.

  4. Add to server.cfg: Include the line ensure ai-paramedic (replace with the script folder's name if different) in your server.cfg file.

  5. 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 to true, 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 to true.

  • Ylean.AllowRemoteRescue: Allows rescue in remote locations (via helicopter) if set to true.

  • Ylean.NotifyViaChat: If true, 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 to true.

  • Ylean.CallAmbulance.CanMove: If set to false, 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, provided UseCommand is set to true.

  • Canceling the Call: If CanMove is set to false, 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:

Locales_en = {
    ambulance_called = "Help has been called. Please wait for the medic to arrive",
    drown_rescue_unavailable = "You cannot be rescued when drowned",
    too_many_medics = "There are currently too many medics online on the server",
    revive_in_progress = "Medic is helping you...",
    examining = "Medic is examining you...",
    surgery_complete = "You have been revived after surgery",
    not_enough_money = "You do not have enough money to call an ambulance",
    cooldown_active = "You need to wait before calling an ambulance again",
    rescue_in_progress = "A rescue is already in progress",
    cooldown_ended = "You can call an ambulance again",
    ambulance_unavailable = "You cannot call an ambulance at this time",
    remote_rescue_unavailable = "Rescue in such a remote location is unavailable",
    player_not_dead = "You are not in a life-threatening condition; you cannot call an ambulance",
    player_winching = "Evacuation using a winch",
    player_bringing = "You are being brought on board",
    process_canceled = "You have canceled the process of requesting help",
    can_not_cancel = "You can no longer cancel the process",
    notify_system = "🚑 Dispatcher 🚑"
}

Adding a New Translation:

  1. Create a new localization file, e.g., ru.lua.

  2. Translate all keys into the desired language.

  3. 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:

Previousylean_armslicenceNextylean_loans

Last updated 1 month ago

Discord:

Discord Server Link
Page cover image