# TowYardPersistence

A RagePluginHook plugin for GTA V that keeps towed vehicles in the Davis Sheriff Station tow yard across sessions.

## Features

- Monitors tow trucks in the world and tracks which vehicle they're towing
- When a tow truck drops off or despawns with a vehicle, it appears in the tow yard
- Light tow yard (15 spots) for standard tow trucks and flatbeds
- Heavy tow yard (2 spots) for heavy-duty tow trucks
- Vehicles persist across sessions — saved to file on despawn and plugin shutdown
- Preserves full vehicle state: engine/body health, dirt level, doors, windows, tires, paint colors (including custom RGB), and extras
- Vehicles spawn with random heading variation for a natural look
- When the yard is full, the oldest vehicle is replaced
- Vehicles that are moved or destroyed are automatically cleared from their slot
- Proximity-based spawning and despawning to minimize performance impact
- 15-second startup delay to avoid load crashes
- ForceReset option in INI to clear all yards

## Requirements

- Grand Theft Auto V
- RagePluginHook (RPH)

## Installation

1. Copy `TowYardPersistence.dll` and `TowYardPersistence.ini` into your GTA V `plugins` folder (e.g. `Grand Theft Auto V\plugins\`).
2. Launch GTA V through RagePluginHook.

## Configuration

Edit `TowYardPersistence.ini` in your `plugins` folder:

[General]
SpawnRadius=120
DespawnRadius=180
SpotRadius=4

[TowYard]
ForceReset=false

- **SpawnRadius** — how close you need to be for the tow yard to spawn vehicles
- **DespawnRadius** — how far away before the tow yard despawns vehicles (saves state first)
- **SpotRadius** — detection radius for each parking spot
- **ForceReset** — set to true to clear all tow yards on next load (resets to false automatically)

## Author

Gamecock Tomahawk
