UZ Scripts
Garage

Job Garages

Configure job-restricted garages with config-based vehicles, grade locks, livery, and extras.

Job garages provide vehicles from the config file — no database required. Vehicles are shared across all officers/employees and are not individually owned.


How It Works

Job Restriction

Set Job to restrict garage access to specific jobs. Only players with the matching job can see the interact option and use the garage.

Config Vehicles

Define a Vehicles table — these vehicles come from the config, not the database. When a Vehicles table is present, the garage operates in job mode.

Grade Lock

Each vehicle can have a minGrade — players below this grade won't see the vehicle in the list.

Store

When a player stores a job vehicle, it's simply deleted. No database updates, no ownership tracking.


Job Field

Prop

Type

-- Single job
Job = 'police',

-- Multiple jobs
Job = {'police', 'ambulance', 'mechanic'},

-- Public (default)
Job = '',

Vehicles Table

Each entry defines a spawnable vehicle with optional grade restriction and visual customization.

Prop

Type

Example

{
    Job = 'police',
    Vehicles = {
        { model = 'police',   label = 'Police Cruiser',     minGrade = 0 },
        { model = 'police2',  label = 'Police Buffalo',     minGrade = 1 },
        { model = 'police3',  label = 'Police Interceptor', minGrade = 3,
          livery = 2,
          extras = {[1] = true, [2] = true, [3] = false}
        },
        { model = 'sultanrs', label = 'Sultan RS (UC)',      minGrade = 2 },
    },
    Type = 'car',
    -- ... other garage fields
}

Grade Reference

Grade values correspond to job grades in your framework:

Uses PlayerData.job.grade.level:

GradeTypical Role
0Recruit
1Officer
2Sergeant
3Lieutenant
4Chief

Uses PlayerData.job.grade:

GradeTypical Role
0Recruit
1Officer
2Sergeant
3Lieutenant
4Chief

Livery & Extras

Applied after the vehicle spawns and also during the camera preview. Both are optional.

Livery

livery = 2,  -- sets vehicle livery index 2

Extras

extras = {
    [1] = true,   -- enable extra 1 (e.g. lightbar)
    [2] = true,   -- enable extra 2 (e.g. pushbar)
    [3] = false,  -- disable extra 3
},

SetVehicleExtra(vehicle, id, disable) uses inverted logic — true in config means the extra is enabled (the script handles the inversion internally).


Job vs Personal Garages

Job GaragePersonal Garage
Vehicle SourceCustomize.lua configDatabase (player_vehicles)
OwnershipShared (job-wide)Individual (per player)
Job fieldRequired (non-empty)'' or omitted
Vehicles fieldRequiredNot used
Damage/Mod SaveNoYes (if enabled)
Spawn FeeAlways freeConfigurable
Store ActionVehicle deletedDB state updated

On this page