Page cover

🚘Vehicle Shops

To add more vehicle shops you can create a new table entry and define the relevant options for that shop

  • The key is the shop name and must be unique

['My Vehicle Shop Name'] = { -- the key is the shop name and must be unique
    --define options
},

Contains shop information

Shop Coords

  • This must be a vector4 value

info = { -- define shop information
    coords = vector4(-55.59, -1097.36, 26.37, 221.96), -- vehicle shop coords
},

Vehicle Spawn Location

  • This must be a vector4 value of where you want a purchased / financed vehicle to spawn

info = { -- define shop information
    --other options
    vehicleSpawn = vector4(-56.79, -1109.85, 26.43, 71.5), -- vehicle spawn coords when purchased
},

Props

  • Set enabled to true to use a prop instead of a target zone for this vehicle shop

  • Then define the prop model name you wish to use

info = { -- define shop information
    --other options
    prop = { -- choose to have a prop spawn at this location instead of a target zone
        enabled = false, -- set to true to enable a prop instead of a target zone
        name = 'prop_parkingpay', -- name of prop model
    },
},

Test Drives

  • Set enabled to true to use the test drive system and allow players to test drive vehicles before purchase (if enabled player owned shops must stock the vehicle first but this is covered in greater detail below!)

  • Define the time in seconds a player is allowed to test drive a vehicle for (if the player exits the vehicle or the timer runs out the test drive is ended and they are teleported back to the store)

info = { -- define shop information
    --other options
    testDrive = { -- define test drive information
        enabled = true, -- enable test drives at this location
        duration = 60, -- in seconds
    },
},

Target Icon

info = { -- define shop information
    --other options
    icon = 'fa-solid fa-car', -- target icon
},

Target Label

  • Define the label you want displayed for the public target interaction

  • Define the label you want displayed for player owned target interactions

info = { -- define shop information
   --other options
    label = 'Open Vehicle Shop', -- target label
    ownerLabel = 'Sell Vehicle To Customer', -- target label if shop is owned
},

Target Distance

  • Define a value for the maximum target distance (bare in mind the number you set for MaxDistance in Config.CoreSettings.Security!)

info = { -- define shop information
    --other options
    distance = 3.0, -- target distance
},

License Checks

  • Set UseLicenseCheck to true to require players to have a license to use this shop

  • Define the license required in LicenseName

info = { -- define shop information
    --other options
    UseLicenseCheck = true, -- set to true to check for a driving license when buying a vehicle
    LicenseName = 'driver', -- metadata name of license type for this shop
},

Payment Type

  • Define the permitted payment types available at this shop

  • Use 'cash' for cash only shops

  • Use 'bank' for bank only shops

  • Use 'both' for both cash and bank shops

  • Use 'item' for item shops or VIP shop (ensure you define the VIPItemName in Config.CoreSettings.Misc)

  • If you have set Type to ox in Config.CoreSettings.Inventory then this script defaults to only allowing cash or item as payment types/ This is because ox_inventory handles money as an item

info = { -- define shop information
    --other options
    paymentType = 'both', -- type of payment allowed at this shop -- if InvType is set to ox it auto sets to cash and item only
    --use 'cash' for cash only
    --use 'bank' for bank only
    --use 'both' for cash and bank
    --use 'item' for item (vip coin or similair make sure you set the item name in Config.CoreSettings.Misc.VIPItemName)
},

Enable player owned shops defined by Citizen ID or a job role

Enabling Player Owned

  • Set enable to true to set this shop as player owned

owned = { -- define owner information
    enabled = true, -- set to true to enable an owner for this location -- make sure you set their citizen id below in 'owner' - if setting to false you must also set owner to nil
},

Owner

  • If you want this shop to have an owner you must define them by their Citizen ID in the owner field otherwise leave this as nil to use a job instead (make sure to define the job name!)

owned = { -- define owner information
    --other options
    owner = nil, -- CITIZEN ID of player that owns this shop -- set to nil for no owner SWG17640
},

Commission

  • Define the percentage value of commission the player should receive per sale or finance agreement (this is only for employees as owners get the full amount)

owned = { -- define owner information
    --other options
    commission = 5, -- what percent of each sale should the owner get commission on
},

Job Name

  • You can define a job as a permitted owner for the vehicle shop

  • Define the job name ensuring this matches your jobs.lua correctly

  • If using no job but only an owner set this to nil

owned = { -- define owner information
    --other options
    job = 'cardealer', -- jobs used for this shop set to nil for no job
},

Stock Levels

  • You can define the min and max amount of stock levels that an owner or employee can order at once

owned = { -- define owner information
    --other options
    stock = { -- define stock supply information
        min = 1, -- min amount of stock that can be ordered at once
        max = 25, -- max amount of stock that can be ordered at once
    },
},

Enabling Stock Collections

  • Set enabled to true to make the owner or employees have to collect a vehicle and deliver it to the shop before counting towards the vehicle stock levels (the funds must be in the society account to order)

  • Define the spawn name of the truck model

  • Define the spawn name of the trailer model

  • Determine whether to warp the player into the vehicle or make them go to it

  • Define random spawn locations for the truck and trailer these must be vector4

  • Define the delivery location where the player must drive to (this should be at the shop) and this must be a vector4

owned = { -- define owner information
    --other options
    collections = {
        enabled = true, -- set to true to make players collect vehicles they have ordered before being able to mark as in stock
        truck = 'hauler', -- truck spawn name
        trailer = 'tr4', -- trailer spawn name that is attached to the truck
        warpPlayer = true, -- set to true to warp the player into the delivery vehicle - set to false to make them go and get it from the spawn location
        locations = { -- define random spawn locations for ther truck and trailer
            vector4(-221.54, -1485.36, 31.31, 225.58),
            vector4(-183.63, -1444.89, 31.32, 135.62),
        },
        delivery = vector4(-26.76, -1082.03, 26.64, 246.81), -- define a delivery locations (usually out the back of the shop or something)
    },
},

Allow players to finance vehicles at this location

  • Set enabled to true to allow players to finance vehicles at this shop location

  • Define the down payment percentage value the player must pay

  • Define the amount of repayments

  • Define the time before repossession warnings are issues if no payments are made

  • Define the time before vehicles are repossessed after failure to make payments

financing = { -- define financing information
    enabled = true, -- enabled finance at this location
    downPaymentPercent = 0.25, -- 25% upfront
    payments = 10, -- 10 payments after down payment
    repoWarningHours = 6, -- ⏰ after X hours, send warning
    repoTimeoutHours = 12, -- β›” after Y hours total, repo it
},

Allow players to sell vehicles at this shop

  • Set enabled to true to allow players to sell vehicles

  • Define coords for the prop to spawn

  • Define the prop model name

  • Define the target icon

  • Define the target label

  • Define the target distance

  • Define the sale value (this is a percentage of the purchase price set in the vehicles.lua)

selling = { -- define selling information
    enabled = true, -- enable selling zone
    coords = vector4(-33.91, -1087.42, 26.42, 248.4), -- prop coords
    prop = 'prop_parkingpay', -- prop name
    icon = 'fa-solid fa-money-bill', -- target icon
    label = 'Sell Vehicle', -- target label
    distance = 3.0, -- target distance
    saleValue = 0.5, -- what percentage of the vehicles original price in vehicles.lua should be given back when selling e.g set to 0.5 will give 50k back from a 100k vehicle sale      
},

Allow blips at this vehicle shop

blip information can be found here: https://docs.fivem.net/docs/game-references/blips/

  • set enabled to true to use blips for this vehicle shop

  • Define the blip id

  • Define the blip scale

  • Define the blip title

blip = { -- define blip information
    enabled = true, -- enable blip for this shop
    id = 326, -- blip id
    colour = 3, -- blip colour
    scale = 0.7, -- blip scale
    title = 'PDM', -- blip name
},

Allow vehicles to spawn at designated coordinates inside a vehicle shop (these are purely decorative and can not be interacted with)

  • Set enabled to true to spawn defined vehicles at this shop

  • Define the radius in which to create a zone around the shop when a player is inside the zone, vehicles are created and then removed if the player leaves again to reduce unnecessary server load

  • Define the vehicle spawn names and coords (these must be vector4)

vehicles = { -- define vehicle objecst to spawn (these can not be interacted with they are purely decorative)
    enabled = true, -- enable vehicle objects to spawn here
    radius = 50.0, -- size of radius for display vehicles
    spawn = {
        { model = 'asbo', coords = vector4(-45.65, -1093.66, 25.44, 69.5), },
        { model = 'comet2', coords = vector4(-39.6, -1096.01, 25.44, 66.5), },
        { model = 'glendale', coords = vector4(-40.18, -1104.13, 25.44, 338.5), },
        { model = 'gauntlet', coords = vector4(-48.27, -1101.86, 25.44, 294.5), },
    },
},

Define categories of vehicles available to purchase at this shop

  • These must match your vehicles.lua to function correctly

  • The key is the category name in your vehicles.lua

  • the value is the label for the menus

categories = { -- define vehicle categories available to purchase here - ensure these are the same as your vehicles.lua
    ['sportsclassics'] = 'Sports Classics', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['sedans'] = 'Sedans', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['coupes'] = 'Coupes', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['suvs'] = 'SUVs', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['offroad'] = 'Offroad', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['muscle'] = 'Muscle', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['compacts'] = 'Compacts', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['motorcycles'] = 'Motorcycles', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['vans'] = 'Vans', -- the key is the category name in your vehicles.lua and the label is for the menu
    ['super'] = 'super cars', -- the key is the category name in your vehicles.lua and the label is for the menu
},

Last updated