# API

Our script has an "API" to check and set thing when some things are done in the garages

````
```lua
--@param garageType string The type of garage (Garages, Impounds)
--@plate string The plate of the vehicle
function CanTakeOutCar(garageType, plate)
    -- Your code logic here
    return true
end

-- Both of them are triggered by the garage script
RegisterNetEvent("mr-garages:client:VehicleTakenOut", function(plate, netId)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    -- Your code logic Here
end)

RegisterNetEvent("mr-garages:client:VehicleStored", function(plate, model, garage)
    -- Your code logic Here
end)

```
````

The "CanTakeOutCar" function is returning if a player can take out a vehicle, this can be used if you want to check for fines, check if the player is dead and etc\
\
The "VehicleTakenOut & VehicleStored" can be used to set data when a vehicle is out of the garage, like nitro script, fake plates and etc


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mr-scripts.gitbook.io/mr-scripts-docs/scripts/advanced-garages/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
