# RSG-Snare - Placeable Snare Trap System
Video Link :
A redM rsg-core script that allows players to place snare traps that automatically hogtie players who walk near them.
## Features
- **Placeable Snare Traps**: Players can place snare traps using the "snare" item
- **Automatic Hogtie**: When a player walks within range of an active snare, they are automatically hogtied
- **Trigger & Reset System**: Snares can be triggered once and then reset by the owner
- **Quality/Durability System**: Snares degrade over time and require maintenance
- **Repair System**: Players can repair their snares for a cost based on quality loss
- **Max Snares Per Player**: Configurable limit on how many snares each player can place
- **Database Persistence**: All snare placements are saved to the database
- **Target Integration**: Uses rsg-target for interaction
- **LEO Confiscation**: Law enforcement can confiscate snares
- **Customizable Locales**: All menu/target options are in locales for easy translation
## Dependencies
- rsg-core
- rsg-target
- ox_lib
- oxmysql
## Installation
1. Copy the `rsg-snare` folder to your `[mack-scripts]` directory
2. Import the SQL schema from `rsg-snare.sql` into your database
3. Add the following item to your items database/shared file:
```lua
['snare'] = {
['name'] = 'snare',
['label'] = 'Snare Trap',
['weight'] = 500,
['type'] = 'item',
['image'] = 'snare.png',
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'A trap that catches unsuspecting victims'
},
```
4. Add `ensure rsg-snare` to your server.cfg
## Configuration
Edit `config.lua` to customize:
- `Config.MaxSnares` - Maximum snares per player (default: 5)
- `Config.SnareModel` - The prop model used (default: `p_netfish01x`)
- `Config.TriggerDistance` - Distance from snare to trigger hogtie (default: 2.0)
- `Config.TriggerCheckInterval` - How often to check for nearby players (default: 500ms)
- `Config.RepairCost` - Cost per quality point to repair (default: 5)
- `Config.CronJob` - How often quality degrades (default: every hour)
## Usage
1. **Placing a Snare**: Use the snare item from your inventory
- Use A/D keys to rotate
- Hold E to place
- Hold Backspace to cancel
2. **Checking a Snare**: Target the placed snare and select "Check Snare"
- View owner, condition, and status
- Reset if triggered
- Repair if damaged
- Pickup when at 100% quality
3. **Triggering**: When a player walks within 2m of an active snare, they are automatically hogtied for 60 seconds
4. **Resetting**: After a snare is triggered, the owner can reset it to active status
## Locales
All menu options and target labels are in `locales/en.lua` and can be translated to any language.
## Credits
Based on the prop placer system from mack-cocaine-dry by Mack Scripts.
## Version
1.0.0 - Initial Release