Exports / Events
Client Event
-- Called on the client where the AI EMS should be dispatched to
--- @param isInstantDispatch: boolean if true dispatch immediately, else delay based on Config.DispatchEMSWaitTime
TriggerClientEvent('wp-ai-ems:client:DispatchAIEMS', isInstantDispatch)
-- Add this event to your HUD script to show an indicator when EMS are enroute to the player
--- @param isEnroute boolean of whether the EMS is enroute to the player
RegisterNetEvent('hud:client:ToggleEMSEnroute', function(isEnroute)
showEmsEnroute = isEnroute
end)
-- Returns a boolean of whether the player is currently being transported by AI EMS
exports["wp-ai-ems"]:isPlayerBeingTransported()
Server Event
-- Server event to dispatch AI EMS, can be used to dispatch to other players.
--- @param targetId - the serverId of the downed player that the AI EMS is dispatched to
-- Example of how to get the current users serverId: GetPlayerServerId(PlayerId())
--- @param isInstantDispatch: boolean boolean if true dispatch immediately, else delay based on Config.DispatchEMSWaitTime
TriggerServerEvent('wp-ai-ems:server:DispatchAIEMS', targetId, isInstantDispatch)
Last updated