# Impound & Auctions

### Information

{% hint style="danger" %}
Police can impound players' vehicles. The auction system works as follows: if a player does not retrieve their impounded vehicle within a set time, the vehicle is transferred to the police department. The police can then go to the auction location and start an auction for that vehicle, selecting a custom duration for the bidding.

All players on the server can place bids on the vehicle, and the highest bidder wins ownership.

If no one places a bid and the auction time expires, the **no\_bidders\_action** option determines the outcome, which can be set to either:

* **"destroy"** – The vehicle is permanently removed.
* **"award\_to\_job"** – The vehicle is transferred to a specific job.
  {% endhint %}

### Configuration of impound auctions

* **menu\_location**: The location where police can interact to start an impound auction.
* **auction\_spots**: The number of available spots, determining how many vehicles can be auctioned at once.
* **auction\_duration**: Duration of each auction (in milliseconds).
* **no\_bidders\_action**: Defines what happens if there are no bidders:
  * **"destroy"** – The vehicle is permanently removed.
  * **"award\_to\_job"** – The vehicle is sent to a job garage as a spawner with a maximum stock of 1.
* **default\_recipient\_job**: The job that will receive the vehicle if the auction ends without bidders.
* **retrieval\_expiration**: The number of days a vehicle remains in the impound before it can be auctioned off.
* **min\_bid\_increment**: The minimum bid increment to prevent spam.
* **buttons**: Five default values created when opening the auction UI.
* **open\_text**: The text displayed where police can interact to open the menu.
* **auction\_effects**: Various effects triggered when someone wins a vehicle.

```lua
impound_auctions = {
    enabled               = true,
    money_account         = "bank",
    menu_location         = vector4(-270.74, -2076.61, 27.62, 246.46),
    auction_spots         = { -- The number of spots will determine how many vehicles can be auctioned at once
        vector4(-265.82, -2088.75, 27.2, 288.37),
        vector4(-266.76, -2085.31, 26.97, 290.15),
        vector4(-267.77, -2082.06, 26.91, 291.93)
    },

    auction_duration      = 60 * 1000,      -- Milliseconds | Duration of each auction
    no_bidders_action     = "award_to_job", -- "destroy" | "award_to_job"  | if there are no bidders, the vehicle will be destroyed or sent to a job garage as a spawner with max 1 stock
    manager_job           = "police",       -- Job that can manage the auctions
    default_recipient_job = {               -- Job that will receive the vehicle if auction ends without bidders
        name = "police",
        grade = 0
    },

    retrieval_expiration  = 5,      -- days | How long will the vehicle be in the impound before it can be auctioned off
    min_bid_increment     = 100,    -- Minimum bid increment  | Avoid spammers
    buttons               = {
        100, 500, 1000, 5000, 10000 -- Only 5 buttons will be shown
    },

    open_text             = "Open Impound Auctions",

    auction_effects       = {
        dictionary = "scr_indep_fireworks",
        name = "scr_indep_firework_starburst",
        iterations = 10,       -- How many times the effects will be played | set to 0 to disable
        iteration_delay = 200, -- Delay between each iteration
        max_distance = 200,    -- How far away from the auction spot the effects will be visible
    }
},
```

### Demonstration Video

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPa9uzNGOcZTp0AwDXTgU%2Fuploads%2FnqJJlu1vYOQiidybu4Cc%2Fimpound.mp4?alt=media&token=dc91ffb7-45f6-441e-b17e-40cf8846f7f5>" %}
