Exports and Events

Here you will find all the useful exports for this asset, please read each step and example carefully to better understand how it works, we do not recommend using these if you are not an experienced developer.

REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!

playerOnBed

With following statebag you can check if some player is on bed.

  • playerId number

Player(playerId).state.playerOnBed

Example of Usage

local playerId = 1 -- replace this with existing player id
local result = Player(playerId).state.playerOnBed
print(result) -- this will print true / false

Damages

With this statebag you can get player damages.

  • playerId number

Player(playerId).state.damages

Example of Usage

local playerId = 1 -- replace this with existing player id
local result = Player(playerId).state.damages
print(json.encode(result, {indent=true})) -- this will print table

ToggleMedicBag

You can use following export to toggle medic bag prop in player hand.

  • state boolean

exports['p_ambulancejob']:ToggleMedicBag(state)

Example of Usage

exports['p_ambulancejob']:ToggleMedicBag(true) -- this will show prop in hand

isDead

With this export you can check if player is dead.

  • playerId number

Player(playerId).state.isDead

Example of Usage

local playerId = 1 -- replace this with existing player id
local result = Player(playerId).state.isDead
print(result) -- this will print true / false

RevivePlayer

With this event you can revive player.

TriggerEvent('p_ambulancejob:RevivePlayer')

Last updated