Documentation
Every Crutches command plus the server and client exports — ForceCrutch, RemoveCrutch and IsCrutchForced — and the event for manual crutches in your own FiveM scripts.
Anyone holding a crutch |
Drops the crutch on the ground. A player with a prescription goes down to crawl until they pick it up with E. |
How another resource puts a player on crutches — a hospital that discharges with a broken leg, a fall-damage script, a death or last-stand system, a medical record that prescribes treatment. Both exports return true on success and false if the player is not online.
Puts the player on crutches for a number of minutes, exactly like a paramedic would: saved to the database, restored after a reconnect, ended automatically when the time is up, and logged to Discord as APPLY_EXPORT. A running prescription is replaced.
---@param targetId number the player's server ID
---@param minutes? number how long; 5 if omitted
---@param reason? string shown to the player after the duration
---@return boolean
exports['qs-crutches']:ForceCrutch(targetId, minutes, reason)-- A hospital discharging a patient with a broken leg
local ok = exports['qs-crutches']:ForceCrutch(source, 20, 'Broken leg')
if not ok then
print('Patient is no longer online')
endThe player is told Crutches applied for 20 minute(s). Reason: Broken leg.
Ends the player's prescription now: the crutch disappears, the walk and controls come back, the saved state is cleared, and it is logged as REMOVE_EXPORT.
---@param targetId number the player's server ID
---@return boolean
exports['qs-crutches']:RemoveCrutch(targetId)-- A full heal, a revive or an admin command
RegisterCommand('healleg', function(source, args)
exports['qs-crutches']:RemoveCrutch(tonumber(args[1]))
end, true)The player is told
Whether the local player is on a prescription right now. Use it to stop an injured player from doing things the crutch controls do not cover — starting a job, entering a race, using an emote.
---@return boolean
exports['qs-crutches']:IsCrutchForced()if exports['qs-crutches']:IsCrutchForced() then
return lib.notify({ description = 'You cannot do that on crutches.', type = 'error' })
endA manual crutch is one the player carries by choice, with no timer: same prop, same walk, same restrictions, but they can put it away whenever they like and dropping it does not force a crawl. It is remembered across reconnects through the crutch_manual column. It is not logged to Discord.
There is no command for it out of the box. Trigger the toggle event from your own script — a radial menu entry, a shop item, a pharmacy:
-- From a client script: equip or put away
TriggerEvent('crutch:client:toggle')
-- From a server script, for a given player
TriggerClientEvent('crutch:client:toggle', source)
-- Optional: a message shown alongside
TriggerEvent('crutch:client:toggle', 'Use /dropcrutch to let go of it.')While a prescription is active the toggle cannot put the crutch away. It only tells the player Crutch is prescribed by EMS; you can't remove it yet.
Given a server ID that is not online, both server exports do nothing, return false and print a line to the server console:
[qs-crutches] Invalid ID 27 for ForceCrutch
[qs-crutches] Invalid ID 27 for RemoveCrutchPass a number, not a string: convert chat arguments with tonumber first.