# ps-housing

{% hint style="warning" %}
This guide has been updated for, and now only works with, **Advanced Garages v3.0 or newer.**
{% endhint %}

Open up `ps-housing/client/cl_property.lua`, find and replace these functions with this code:

```lua
function Property:RegisterGarageZone()
    if not next(self.propertyData.garage_data) then return end

    if not (self.has_access or self.owner) then
        return
    end

    local garageData = self.propertyData.garage_data
    local garageName = string.format("property-%s-garage", self.property_id)

    local data = {
        takeVehicle = {
            x = garageData.x,
            y = garageData.y,
            z = garageData.z,
            w = garageData.h
        },
        type = "house",
        label = self.propertyData.street .. self.property_id .. " Garage",
    }

    self.garageZone = lib.zones.box({
        coords = vec3(garageData.x, garageData.y, garageData.z),
        size = vector3(garageData.length + 5.0, garageData.width + 5.0, 3.5),
        rotation = garageData.h,
        debug = Config.DebugMode,
        onEnter = function()
            if IsPedInAnyVehicle(PlayerPedId(), true) then
                lib.showTextUI('Press [E] to put the vehicle in the garage')
            else 
                lib.showTextUI('Press [E] to open the garage')
            end
        end,
        inside = function()
            if IsControlJustReleased(0, 38) then
                Wait(100)
                inGarage = false
                if IsPedInAnyVehicle(PlayerPedId(), true) then
                    TriggerEvent('jg-advancedgarages:client:store-vehicle', garageName, "car")
                else
                    TriggerEvent('jg-advancedgarages:client:open-garage', garageName, "car", vec4(garageData.x, garageData.y, garageData.z, garageData.h))
                end
            end
        end,
        onExit = function()
            lib.hideTextUI()
        end,
    })
end

function Property:UnregisterGarageZone()
    if not self.garageZone then return end

    self.garageZone:remove()
    self.garageZone = nil
end
```


---

# 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://docs.jgscripts.com/advanced-garages/integrations/ps-housing.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.
