βοΈConfiguration
RISK.Framework
"auto" | "esx" | "qbcore"
auto
RISK.DurationSeconds
Default duration when triggered
300
RISK.Persist.Enable
Save & resume remaining time
true
RISK.Persist.File
JSON file name (in resource folder)
"data.json"
RISK.Debug
Extra prints/toggles
false
BlockMelee
Punching/melee
true
BlockShooting
Fire weapons
true
BlockAiming
Aim down sights
true
BlockReload
Reload
true
ForceUnarmed
Forces unarmed weapon
true
AllowInVehicles
Allow staying in vehicle
true
BlockSprint
Sprint key
false
BlockEnterVehicle
Enter vehicle
false
RISK.RemoveCommand
/ri <id>
Clear incapacitation for a player
RISK.GiveCommand
/gi <id> <seconds>
Apply/incapacitate for X seconds
RISK.RadiusRemoveCommand
/riz <meters>
Clear all players in radius around you
Skip-Zones
Disable the system when a player is inside your event arenas:
RISK.SkipZones = {
{ resource = "fs_ffa", export = "IsInZone", args = {} },
{ resource = "frp_airdrop", export = "IsInZone", args = {} }
}
If the export returns true
, incapacitation wonβt start and pills wonβt apply.
Revive Hooks
Triggered when these events fire (edit to match your ambulance job):
RISK.ReviseEvents = {
{ scope="client", event="esx_ambulancejob:revive" },
{ scope="client", event="esx_ambulancejob:revivePlayer" },
{ scope="client", event="hospital:client:RespawnAtHospital" },
{ scope="client", event="hospital:client:Revive" },
{ scope="client", event="qb-ambulancejob:client:Revive" },
{ scope="client", event="revive:client:Revive" },
}
Items (Pills)
Each pill reduces remaining time by a percentage and can be job-restricted:
RISK.Items = {
{
name = "risk_pille", -- item name
percent = 50, -- reduce remaining time by 50%
useTime = 6000, -- ms anim time
prop = "prop_cs_pills", -- prop model
animDict = "mp_player_intdrink",
anim = "loop_bottle",
bone = 18905,
offX = 0.14, offY = 0.025, offZ = 0.04,
rotX = -90.0, rotY = 0.0, rotZ = 0.0,
allowedJobs = { "ambulance", "police" } -- empty = everyone
},
{ name="risk_pille_s", percent=25, useTime=6000, prop="prop_cs_pills",
animDict="mp_player_intdrink", anim="loop_bottle", bone=18905,
offX=0.14, offY=0.025, offZ=0.04, rotX=-90.0, rotY=0.0, rotZ=0.0,
allowedJobs={} }
}
Inventory support: ESX, QBCore, and ox_inventory are all supported. The script auto-registers the items as usable when those resources are running.
Notifications
Use your own UI or default GTA feed:
RISK.UseCustomNotify = true
RISK.Functions.notify = function(ntype, title, text, time)
exports['risk-notify']:Notify({
type = ntype or 'info',
title = title or 'Incapacitated',
message = text or '',
duration = time or 6500
})
end
π¨ UI Theming (config.css
)
config.css
)Tweak the in-game widget without touching Lua.
--risk-accent-1/2
Brand color(s)
#fefe02
--risk-glow-color
Outer glow
rgba(255,255,0,.85)
--risk-svg-size
Icon size
clamp(120px,12vw,244px)
--risk-title
/ --risk-time
Font sizes
clamp(12px,1.1vw,17px)
/ clamp(18px,1.6vw,28px)
--progress
Fill percent (managed by script)
100%
Change
--risk-accent-1
and--risk-glow-color
to quickly re-skin the bar.
π§ͺ Quick Recipes
Add a new EMS-only pill (-35%)
table.insert(RISK.Items, {
name="ems_pill_m",
percent=35,
useTime=5000,
prop="prop_cs_pills",
animDict="mp_player_intdrink",
anim="loop_bottle",
bone=18905,
offX=0.14, offY=0.025, offZ=0.04,
rotX=-90.0, rotY=0.0, rotZ=0.0,
allowedJobs={"ambulance"}
})
Make players unable to enter vehicles while incapacitated
RISK.BlockEnterVehicle = true
RISK.AllowInVehicles = false
Persist off
RISK.Persist.Enable = false
π Developer API (simple)
You can trigger/clear from other scripts:
-- Force start for player with X seconds
TriggerClientEvent('risk_kampf:force_begin', playerId, seconds)
-- Force clear for player
TriggerClientEvent('risk_kampf:force_clear', playerId)
Server tracks state; persistence is handled automatically when enabled.
Last updated