v1.0.9 security
Crutches only EMS can apply, no more stuck props and a clean leave
15changes

Crutches only EMS can apply, no more stuck props and a clean leave
15changes

[02] Release
The server now checks every EMS action before a crutch is applied or removed, so players can no longer force or shorten crutches with fake events or items. Crutch props no longer get stuck or vanish from nearby players, everything is cleaned up when a player leaves, and the database runs async with a startup self-check.
crutch_manual and crutch_forced_until). The script checks them at start and adds them once if they are missing. To do it by hand, run the section for your framework in [sql]/database.sql.config.lua: Config.MaxCrutchMinutes, Config.MaxApplyDistance and Config.AllowEmsById. If you keep your old config.lua, they fall back to safe defaults, so nothing breaks.onesync and oxmysql. Make sure both are running.Config.Debug is now false by default. Turn it on only while you are testing.
Replace every file in the resource, except what you edited yourself:
client/ — main.lua, modules/menu.lua, custom/custom.lua, custom/framework/esx.lua, custom/framework/qb.lua.server/ — main.lua, modules/menu.lua, modules/selfcheck.lua (new), modules/throttle.lua (new), framework/esx.lua, framework/qb.lua, webhook.lua, version.lua.config.lua, shared.lua, fxmanifest.lua, [sql]/database.sql (new), CHANGELOG.md (new).Applying or removing a crutch is now validated on the server: the job, that the target player exists, that both players are in the same routing bucket, the distance, the duration and the reason. Players can no longer force crutches on others with fake events.
Using a crutch item no longer cuts short the time of a crutch that EMS applied.
The crutch item could be used without having it in the inventory. The server now checks that the player owns it.
All crutch events now have rate limits, so spamming them no longer affects the server.
Webhook URLs must now start with https://.
The crutch state and props are removed correctly when a player disconnects, logs out in a multicharacter system or the resource stops.
A startup self-check warns about missing database columns and adds them once. The schema is also included in [sql]/database.sql.
New Config.MaxCrutchMinutes (longest time EMS can apply in one action), Config.MaxApplyDistance (max distance between EMS and patient) and Config.AllowEmsById (whether the By ID option ignores distance). Old configs fall back to safe defaults.
Config.Debug is now false by default, and debug messages are formatted correctly.
The new update checker prints a short summary when a new version is out and stays quiet until another one ships.
Scripts are listed explicitly, escrow_ignore paths are fixed, and onesync and oxmysql are declared as dependencies.
A nil error in GetItem crashed the item check on QBCore.
Picking up the crutch during the animation could leave an extra prop behind.
Removing your crutch could delete the crutches of players around you.
All queries now run asynchronously with oxmysql, and unnecessary database writes were removed.