Exports / Events
Series of exports that will be added as time goes on. These are good for implementing radial menus and usage of 3rd party scripts for Wasabi Ambulance Job (wasabi_ambulance) the legacy version.
Client Exports
isPlayerDead
exports.wasabi_ambulance:isPlayerDead(serverId)
Returns if player is dead. If used without serverId parameter it will return the death status of the local player
serverId: Server ID
diagnosePlayer
exports.wasabi_ambulance:diagnosePlayer(targetPlayer)
diagnoses a nearby dead player, notifying about their injuries. Depending on the targetPlayer parameter, it either returns a context menu for checking a nearby player or an injury table.
targetPlayer:
boolean:(true): Diagnoses the local player.number:Diagnoses the player with the specifiedserverID.nil:Diagnoses a nearby player (requires the configured ambulance job).
Returns:
- Context Menu: For checking a nearby player when
targetPlayerisnil. - Injury Table: For diagnosing the local player or a player with a specified
serverID.
treatPatient
exports.wasabi_ambulance:treatPatient(injury)
Treats a nearby player for whichever injury is place in the injury parameter. Restricted to 'ambulance' and 'police' jobs (Possible Injuries: shot, stabbed, beat, burned)
INJURY: 'shot', 'stabbed', 'beat', 'burned
reviveTarget(using item)
exports.wasabi_ambulance:reviveTarget()
Performs CPR and revives nearby player given they have the item requirement
healTarget
exports.wasabi_ambulance:healTarget()
If no close by player OR non-ambulance, it will perform a self-heal given the player has the required item. Otherwise it will start healing nearby player
useSedative
exports.wasabi_ambulance:useSedative()
Performs the act of sedating nearby player. If you lack the required item or there are no nearby players, it will notify you of failure
placeInVehicle
exports.wasabi_ambulance:placeInVehicle()
Places nearby player in vehicle. If not player nearby it will notify you of failure.
loadStretcher
exports.wasabi_ambulance:loadStretcher()
Will place a nearby player on a nearby stretcher. Recommended to check for nearby stretcher prior to executing this export
openOutfits
exports.wasabi_ambulance:openOutfits(hospital)
Opens outfit menu for whichever hospital ID(The name you give each hospital in Config.Locations
HOSPITAL: Location identifier
deleteStretcherFromVehicle
exports.wasabi_ambulance:deleteStretcherFromVehicle(VEHICLE)
Checks for stretcher and deletes from specific vehicle.
VEHICLE = vehicle ID
isPlayerUsingStretcher
**exports.isPlayerUsingStretcher(PLAYER_CLIENT_ID)
**
Returns true if the player is on a stretcher; otherwise, it will return false.
PLAYER_CLIENT_ID: Client ID
Example:
function CarryPlayer(ped)
if not IsPedAPlayer(ped) then return end
local playerID = NetworkGetPlayerIndexFromPed(ped)
if not playerID or exports.isPlayerUsingStretcher(playerID) then return end
-- .. Rest of code involving carrying someone
end
clearPlayerInjury
exports.wasabi_ambulance:clearPlayerInjury(clearVitals)
Executes the action of clearing the player's injuries.
CLEARVITALS : bool (if true, will heal HP, hunger, health, etc)
disableKnockoutLoop
exports.wasabi_ambulance:disableKnockoutLoop(disabled)
Will disable/enable knockout loop for 3rd party scripts for specific user.
disabled (bool): true/false
manuallyKnockout
exports.wasabi_ambulance:manuallyKnockout(enabled)
Will knock out local user when enabled is passed as true, or allow them to get back up by passing false.
enabled (bool): true/false
Server Exports
RevivePlayer
exports.wasabi_ambulance:RevivePlayer(SERVER_ID)
Will revive player with server id passed through SERVER_ID
SERVER_ID: Server Id
disableKnockoutLoop
exports.wasabi_ambulance:disableKnockoutLoop(source, disabled)
Will disable/enable knockout loop for 3rd party scripts for specific user.
source (number): Server ID of target user
disabled (bool): true/false
manuallyKnockout
exports.wasabi_ambulance:manuallyKnockout(source, enabled)
Will knock out target user when enabled is passed as true, or allow them to get back up by passing false.
source (number): Server ID of target user
enabled (bool): true/false
Client Events
wasabi_ambulance:deleteStretcherFromVehicle
TriggerClientEvent('wasabi_ambulance:deleteStretcherFromVehicle', SERVER_ID, NETID)
Will remove the stretcher from a vehicle, server-sided.
SERVER_ID: Server Id
NETID : Vehicle net ID that