Exports

Reference for the ambulance job exports and radial menu actions.

Server exports

revive(playerId)

  • Purpose: Revives the supplied player.
  • Arguments:
    • playerId (number|string): The server ID of the player that should be revived.
  • Returns: boolean (true when the revive was triggered, false for an invalid or offline target).

Client exports

openRadialMenu()

  • Purpose: Opens the medic radial menu as if the player pressed the configured hotkey.
  • Returns: boolean (true when the menu opens, false when the feature is disabled).

getRadialActions()

  • Purpose: Provides the current list of radial menu actions along with labels, descriptions, and availability metadata.
  • Returns: RadialAction[] where each entry contains id, label, description, icon, available, and optional badge or helper fields.
  • Usage: Useful for backing custom UI mirrors or gathering telemetry on action availability.

getRadialAction(actionId)

  • Purpose: Fetches a single action snapshot by actionId.
  • Arguments:
    • actionId (string)
  • Returns: The action snapshot (same structure as getRadialActions entries) or nil when missing.

getRadialActionReport()

  • Purpose: Bundles the action list with a quick lookup map for availability and reason information.
  • Returns: Object with actions (from getRadialActions()) and availability, where each key maps to an available, disabledReasonKey, and disabledReason pair.
  • Usage: Ideal for dashboards that must display enabled/disabled state or explain why an action is unavailable before prompting players to open the radial menu.

isRadialMenuActionAvailable(actionId)

  • Purpose: Tests if a radial menu action is currently enabled for the calling player without opening the menu.
  • Arguments:
    • actionId (string)
  • Returns: boolean (true when the action exists and is enabled, false otherwise).
  • Notes: Availability mirrors the logic used to populate the radial action list (job/duty checks, context distances, etc.).

triggerRadialMenuAction(actionId)

  • Purpose: Executes the same handler the radial menu would for the given action, enabling other resources to treat, carry, or bill without opening the UI.
  • Arguments:
    • actionId (string)
  • Returns:
    • boolean: true when the action was accepted.
    • table?: When the action fails, the handler returns a map with key/fallback for mirrored notification text.
  • Notes: The export closes the radial menu if it was open and reuses the existing notification messaging for failures.

Radial Menu Actions

Each action mirrors the descriptions and availability logic of the in-game radial UI.

  1. stretcher_carry Interact with the nearby stretcher (pick up, carry, or place) while accounting for distance and state.
  2. stretcher_patient Assign or release a patient from the active stretcher, respecting proximity and carry state.
  3. stretcher_vehicle Load or unload the active stretcher from the assigned vehicle when a patient or vehicle is nearby.
  4. wheelchair_push Push or release a wheelchair patient when the wheelchair system is enabled, a chair is close, and the medic is on foot.
  5. carry_patient Pick up or drop the closest person, tracking carry modes, distance badges, and restrictions (e.g., already carried or incapacitated).
  6. treat_patient Diagnose and treat the closest patient, with distance badges and job/duty gating.
  7. billing Open the billing interface for the nearest patient, including context badges and availability checks.