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

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)

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

Target Distance

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

License Checks

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

  • Define the license required in LicenseName

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


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

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!)

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)

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

Stock Levels

  • You can define the min and max amount of stock levels that an owner or employee can order 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


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


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)


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


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)


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


Last updated