createGarage

Create a new garage from an external resource.

-- ARGUMENTS
-- id:                    string (Must be unique amongst garages)
-- typeof:                string (Zone, nui, menu)
-- label:                 string
-- capacity:              number (-1 for unlimited capacity)
-- blip:                  table  (Check example below)
-- classRestrictions:     table  (Check example below, or existing examples in garages.lua)
-- jobRestrictions:       table  (Same as above)
-- groupRestrictions:     table  (Same as above)

-- NOTE:
-- Final arguments depend on garage type.

-- With zone type:
-- points:                table  (Table of vector3 points)
-- height:                number (Polyzone height)

-- With nui type:
-- vehSpawn:              table (Location of vehicle spawn)
-- pedMenu:               table (Location of menu while on foot)
-- vehMenu:               table (Location of menu while in vehicle)
-- showroomCam:           table (Location of showroom preview camera)
-- showroomVeh:           table (Location of showroom preview vehicle)

-- With menu type:
-- vehSpawn:              table (Location of vehicle spawn)
-- pedMenu:               table (Location of menu while on foot)
-- vehMenu:               table (Location of menu while in vehicle)

-- RETURNS
-- nil

local id = "testing"
local label = "Testing Garage"
local capacity = -1
local blip = {
    label = "Pillbox Hill Zone",
    position = vector3(223.73,-787.48,30.75),
    sprite = 357,
    color = 57,
    alpha = 255,
    scale = 0.7,
    display = 2,
    highDetail = true,
    shortRange = true
}

local classRestrictions = {
    -1
}

local charRestrictions = {
    'steam:abc123',
}

local jobRestrictions = {
    police = 2,
    mechanic = 3
}

local groupRestrictions  = {
    ballas = 2,
    grove = 0
}

local zonePoints = {
    vector3(200.01,-805.80,30.75),
    vector3(218.77,-756.46,30.75),
    vector3(262.78,-769.80,30.75),
    vector3(257.55,-784.84,30.75),
    vector3(252.84,-783.64,30.75),
    vector3(239.86,-820.42,30.75)
}

local zoneHeight = 3.0

local locations = {
    vehSpawn = {
        position = vector3(241.60,-756.66,30.83),
        heading = 256
    },

    pedMenu = {
        position = vector3(241.60,-756.66,30.83),
        interactDist = 2.0,
    },

    vehMenu = {
        position = vector3(241.60,-756.66,30.83),
        interactDist = 2.0,
    },

    showroomCam = {
        position = vector3(-1332.21,146.94,-96.87)
    }, 

    showroomVeh = {
        position = vector3(-1327.08,142.80,-99.19),
        heading = 137.03
    }
}

-- Creating a zone type garage
exports.ti_garages:createGarage(
    id,
    "zone",
    label,
    capacity,
    blip,
    classRestrictions,
    charRestrictions,
    jobRestrictions,
    groupRestrictions,
    zonePoints,
    zoneHeight
)

-- Creating a menu type garage
exports.ti_garages:createGarage(
    id,
    "menu",
    label,
    capacity,
    blip,
    classRestrictions,
    charRestrictions,
    jobRestrictions,
    groupRestrictions,
    locations.vehSpawn,
    locations.pedMenu,
    locations.vehMenu
)

-- Creating an nui type garage
exports.ti_garages:createGarage(
    id,
    "menu",
    label,
    capacity,
    blip,
    classRestrictions,
    charRestrictions,
    jobRestrictions,
    groupRestrictions,
    locations.vehSpawn,
    locations.pedMenu,
    locations.vehMenu,
    locations.showroomCam,
    locations.showroomVeh
)

Last updated