Search Players
One Inventory lets a player search another player's inventory (the police "frisk" feature). There are two ways someone is allowed to search a target:
- By job - anyone whose job is in the allowed-jobs list can search anyone.
- By vulnerability - everyone else can only search a target that is in an enabled "vulnerable" state (dead or in last stand, cuffed, hands up, or otherwise marked searchable).
Configuration
Configure it in the admin panel under Config -> Gameplay -> Search:
Vulnerable states
A target counts as vulnerable when an enabled state is active. One Inventory tracks each state itself and reacts; you don't set our own dead / cuffed statebags. Each state is sourced differently:
| State | How One Inventory knows |
|---|---|
| Dead (or in last stand) | Tracked internally from your framework's death and last-stand metadata / events, with the "fatally injured" native (IsPedFatallyInjured) as a fallback. |
| Cuffed | Tracked internally from your framework's cuff events. Also reads an external state.cuffed statebag (so other police scripts keep working), and falls back to the cuffed native (IsPedCuffed). |
| Hands up | External input: your hands-up script sets state.handsup, or the target plays a configured hands-up animation. |
| Searchable | External input: any script sets state.searchable to mark a target "vulnerable for any reason". |
Dead, cuffed, and hands up are also matched against per-state search animations, which are configured in the admin panel (see Option 2).
Integrating a custom hands-up or vulnerability script
If you run a hands-up, restrain, or minigame script that should make a player searchable, you have two options. Use whichever fits your script.
Option 1: set the statebag
Set the matching state when your script makes the player vulnerable, and clear it when they're no longer vulnerable.
-- Generic "vulnerable for any reason" (any script):
-- Server
Player(src).state:set('searchable', true, true)
-- Client
LocalPlayer.state:set('searchable', true, true)
-- Hands-up specifically, if your script doesn't already set it:
LocalPlayer.state:set('handsup', true, true)
searchable and enable the "searchable" toggle).Option 2: play a recognised animation
One Inventory also matches a set of animations per state. If your script plays a configured animation for that state, the target is flagged automatically, with no statebag to set. Manage these per state in the admin panel's Search config; the matching toggle under Allow searching on still has to be enabled.
Sensible defaults are seeded, and you can add or remove animations in the panel:
Cuffed
mp_arresting/idleanim@move_m@prisoner_cuffed/idle
Dead
dead/dead_a
Hands up
missminuteman_1ig_2/handsup_basemissminuteman_1ig_2/handsup_enterrandom@mugging3/handsup_standing_base
