# phils-wanted
A **RedM** (Red Dead Redemption 2) resource for **RSG-Core** that provides a native-style wanted UI system. It displays region-aware wanted level notifications, search pulses, and bounty hunter messages using RDR3's native data-binding system.
## Features
- **Native Wanted UI** — Uses RDR3's data-binding natives (`DatabindingAddDataContainer`, `DatabindingAddDataString`, etc.) for a seamless, rockstar-style wanted display
- **Region-Aware Law System** — Automatically detects the player's current town or district (Saint Denis, Valentine, Rhodes, Blackwater, etc.) and sets the appropriate law jurisdiction
- **Wanted State Machine** — Three-state system: `NONE` → `WANTED` (known location) → `SEARCHING` (law searching area)
- **Per-Region Wanted Blips** — Shows a wanted region blip on the minimap outlining the town or district where the player is wanted
- **Configurable Crime Text** — Customizable crime description displayed in the wanted UI (via config or network event)
- **Event-Driven** — Supports `law:client:startSearching` / `law:client:stopSearching` events for external law enforcement scripts
- **HUD Management** — Shows/hides minimap and other HUD components based on wanted state
## Installation
1. **Download** the `nativewanted` folder
2. **Place** it in your server's `resources` directory
3. **Add** to your `server.cfg`:
```
ensure nativewanted
```
4. **Ensure** `rsg-core` is loaded before this resource
## Configuration
Edit `config.lua`:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `Config.WantedUIEnabled` | `bool` | `true` | Toggle the wanted UI on/off |
| `Config.CurrentCrimeText` | `string` | `"For Crimes: Around the region"` | Default crime text shown in the wanted UI |
## Events
### Client Events (exported)
| Event | Parameters | Description |
|-------|------------|-------------|
| `nativewanted:setCrimeText` | `crime` (string) | Updates the crime description in the wanted UI |
| `law:client:startSearching` | — | Triggers the "Law Searching" state |
| `law:client:stopSearching` | — | Clears the "Law Searching" state |
## Supported Regions
**Towns:** Saint Denis, Valentine, Rhodes, Blackwater, Strawberry, Annesburg, Van Horn, Armadillo, Tumbleweed
**Districts:** The Heartlands, Cumberland Forest, Roanoke Ridge, Scarlett Meadows, Bluewater Marsh, Bayou Nwa, Big Valley, Great Plains, Tall Trees, Cholla Springs, Rio Bravo, Gaptooth Ridge, Hennigan's Stead, Grizzlies East, Grizzlies West
## Dependencies
- [RSG-Core](https://github.com/Rexshack-RedM/rsg-core) — Required RedM roleplay framework