Skip to main content
Public hooks for integrating other resources — ambulance jobs, custom HUDs, scripted incidents. Resource name is nex_crutchsystem.

Server exports

ExportReturnsUse case
ForceCrutch(target, durationSeconds?, label?)booleanForce-equip a crutch on a player. durationSeconds defaults to Config.ForceDuration. label shows in the admin panel (default 'EMS').
ClearForce(target)booleanRemoves the force lock without unequipping.
RemoveCrutch(target)booleanClears the force lock and unequips the prop.
ListForced()table[]Snapshot of every currently-forced player: { id, name, secondsLeft, sourceLabel }.
IsPlayerCrutched(src)booleanIs this player currently using a crutch (item-use or force).
PlayerHasCrutch(src)booleanAlias of IsPlayerCrutched.
PlayerNearMedic(src)booleanIs the player within any Config.MedicLocations radius.
useCrutch(source, item, slot, data)ox_inventory server.export target. Don’t call directly.

Client exports

ExportReturnsUse case
SetWalkStyle(walk)Sets the clip-set to restore after the crutch is unequipped.
IsUsingCrutch()booleanIs the local player currently limping with a crutch.
IsForced()booleanIs the local player under a force lock.

Example — ambulance job auto-force after revive

In your ambulance job’s server script, after a successful revive:
exports.nex_crutchsystem:ForceCrutch(playerId, 600, 'EMS')
The patient gets a crutch for 10 minutes, can’t manually unequip it, and shows up in /crutchadmin with EMS as the source label.

Example — read crutched state from another resource

if exports.nex_crutchsystem:IsPlayerCrutched(source) then
    -- e.g. block running, disable sprint sound, halve max stamina
end

Example — restore a custom walk style after unequip

Some scripts override SetPedMovementClipset. Tell the crutch system what to restore:
exports.nex_crutchsystem:SetWalkStyle('move_m@drunk@verydrunk')
The next time the crutch is unequipped, the player’s clip-set is restored to that value instead of the default.

Net events

Only the events you’d reasonably trigger from another resource are listed. Prefer the exports above — they also keep the server’s equipped[] and forcedPlayers[] tracking tables in sync.

Server → client

EventArgsEquivalent export
nex_crutchsystem:client:crutchtoggle from inventory use
nex_crutchsystem:client:forceCrutchduration?ForceCrutch
nex_crutchsystem:client:clearForceClearForce
nex_crutchsystem:client:forceRemoveRemoveCrutch
Calling TriggerClientEvent('nex_crutchsystem:client:forceCrutch', src, 600) will visually equip the crutch on the client, but won’t register the player in the server-side tracking tables — IsPlayerCrutched, ListForced, and /crutchadmin won’t know about them. Always use the ForceCrutch export for force locks initiated outside the resource.