Description: This script implements a dynamic wanted system for RedM, allowing law enforcement officers to mark players as wanted. Key features include:
- Commands and UI
- /posse
- Police-only. Opens a UI to select a player, set wanted level (0–6), and choose whether to send AI trackers.
- /setwanted [playerID] [wantedLevel] [sendTrackers]
- Police-only. Direct command version.
- playerID: the target player's server ID
- wantedLevel: integer 0–6 (0 to clear wanted)
- sendTrackers: optional; true by default. Pass false to skip AI trackers
Behavior
- When a player is set wanted with trackers, the client spawns the configured number of trackers and informs the server.
- Each time a tracker dies, the client notifies the server. The server tallies remaining trackers and clears wanted when all are dead.
- Wanted is also cleared by:
- Police setting wanted level to 0
- The wanted player dying
- Blips:
- The wanted player has a personal blip updated in place while wanted
- Law sees blips for wanted players; non-law never sees wanted blips
- Notifications use ox_lib (lib.notify) and will show appropriate success/error/inform banners.
Admin tips
- If you use custom job names, ensure job.type is set to 'leo' for your police job (in rsg-core jobs config).
- You can scale difficulty by increasing TrackerCountByLevel.
Troubleshooting
- I don’t see ox_lib notifications
- Ensure ox_lib is started before this resource.
- Law can’t open /posse
- Verify PlayerData.job.type is 'leo' for your police characters.
- Trackers don’t spawn
- Confirm rsg-input is running (used by /posse UI). You can still use /setwanted ID LEVEL true.
- Too many threads / performance issues
- This version runs a single pursuit thread per tracker and updates blips in place to minimize churn.