Ownership
Bought, free, job owned, and the second owner.
Who a garage belongs to is decided by two fields on it: the price, and whether it is a job garage.
For sale
A garage with a price above 0 is sold by a seller NPC. The player walks up, sees the garage from its showcase camera, and buys it. Only then is it theirs.
Config.Sellers = {
enabled = true,
npcs = {
{
position = vector3(109.24, -636.58, 44.24),
heading = 71.00,
model = "csb_reporter",
useDistance = 2.0,
blipColor = 69,
blipSprite = 369,
blipText = "Garage Seller",
},
},
}Every key here is read as it stands. useDistance is how close a player has to be before the seller can be talked to, and blipSprite, blipColor and blipText go straight into the blip on the map. None of them has a default behind it, so an entry that leaves one out breaks when the seller is placed.
Selling it back pays out a share of the price. The share sits on the garage itself and starts at Config.Builder.defaultSalePercentage, which is 0.2, so a fifth of what it cost.
Free
A price of 0 gives the garage to every player from the start. It never shows up at a seller, and nobody can sell it back. This is what to use for the public garage everyone should be able to park in.
Job owned
A job garage belongs to a job, not to a player. Everybody with that job walks in, nobody buys it, nobody sells it. The price is not read at all, so a job garage at price 0 stays with the job instead of falling to every player.
On QBox and ox_core a player can hold several jobs at once. Any of them counts, so the second job opens its garage without switching.
Which vehicles employees may take in is on Vehicle access.
The second owner
An owner can hand a garage to other players without giving it away. The guest stands in the invite zone, the owner invites them from the manage menu.
Config.CoOwnership = {
maxCoOwners = 5,
requireOwnerPresent = false,
allowCoOwnerInvites = false,
}requireOwnerPresent is the difference between a shared garage and a lent one. Off, a co-owner uses the garage like their own. On, they cannot enter without the owner and they leave when the owner leaves.
allowCoOwnerInvites lets a co-owner invite further players. Off, only the owner does.