🔁Compatibilities

Exports:

--@type {name:string, coords:vector4, radius:number, spawn:vector4, carType:"car"|"air"|"sea"}
local data ={
  name = "HOUSE 1",
  coords = vector4(1,2,3,4)
  radius = 5.0,
  spawn = vector4(1,2,3,4),
  carType = "car"
}
--- Create Housing
local id = exports["m-Garages"]:createHousingGarage(data)
--- Remove housing
exports["m-Garages"]:deleteHousingGarage(id)

PS-Housing

  • ps-housing/client/cl_property.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)

    ---@type {name:string, coords:vector4, radius:number, spawn:vector4, carType:"car"|"air"|"sea"}
    local data = {
        name = garageName,
        coords = vector4(
            garageData.x,
            garageData.y,
            garageData.z,
            garageData.h
    ),
        radius = 5.0,
        spawn = vector4(
            garageData.x,
            garageData.y,
            garageData.z,
            garageData.h
        ),
        carType = "car",
    }

    self.garageId = exports["m-Garages"]:createHousingGarage(data)
end

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

    exports["m-Garages"]:deleteHousingGarage(self.garageId)
    self.garageId = nil
end

Last updated