This page will outline and explain how to create a configuration module and how to configure the vehicle for its setup.
Creating a configuration module
1
Navigate to the modules folder
Please navigate to the modules folder within the resource, which can be found at the following path.
settings > modules
2
Create a new file
Now that you are in the appropriate location, please proceed to create your module file. This can be accomplished by copying and pasting the provided example file.
3
Renaming your file
Now you have a new module file, Please ensure the name of the file is the spawn code you entered in the cfg.vehicles table.
4
Vehicle Configuration
You now have a new work vehicle! Within the file you create, there are configurable variables and values that are unique to the vehicle. The details regarding this content are explained later on this page.
Door Id
This variable takes a string input, which should correspond to the door ID you wish to interact with on this vehicle. All door IDs are listed below.
Driver Side Front : dside_f
Driver Side Rear : dside_r
Passenger Side Front : pside_f
Passenger Side Rear : pside_r
Bonnet / Hood : bonnet
Boot / Trunk : boot
---@field bootOffset vector3---@description: This parameter enables the configuration of the boot interaction position on the vehicle.doorId ='boot',
Compartments
This table contains various variables. Within this table, there are two sub-tables; however, there may be instances where only one sub-table exists. The main sub-table corresponds to the main inventory page, while the weaponSafe sub-table pertains to the locked weapon safe inventory tab. Below is an example of a vehicle with and without a weapon safe.
return { ---@field bootOffset vector3---@description: This parameter enables the configuration of the boot interaction position on the vehicle. doorId ='boot',---@field compartments table---@description: .... ['compartments'] = { main = { slots =18, items = { ['Breathalyzer'] =1, ['Drug Swab'] =2, ['Police Jacket'] =1, ['Traffic Cone'] =3, ['Road Closed Sign'] =1, ['Police Accident Sign'] =1, ['Police Slow Sign'] =1, ['Vehicle Stinger'] =3, ['First Aid Kit'] =2, ['Police Tape'] =2, ['Fire Extinguisher'] =1 } }, }}
Slots
This variable accepts an integer input, representing the number of slots within this inventory tab.
slots =18,
Adding new items
Adding new items to your inventory tab is straightforward. Below, you will find an example of an item. This item can be divided into two sections. The first section is the string, which represents the item name and can be found in the items.lua file. The second section indicates the quantity of the item that these vehicles can hold.