DIVERSITY

Documentation

Inventory Integration

By following these steps, you'll enable players to interact with items in the way our script intends, ensuring proper behavior and compatibility.

ox_inventory

If you have Config.ENABLE_RIGHT_CLICK_AIMING enabled:

  1. Open your server.cfg file.
  2. Copy and paste the line below into the file to configure the ignored weapons for your inventory system:
    setr inventory:ignoreweapons ["WEAPON_BALL"]
  3. Save the file after adding this line.

Locate the Configuration File

  1. Open your server's resources folder and navigate to the ox_inventory directory.
  2. Inside, locate the data/items.lua file. This file contains the definitions for all items used in the inventory.

Define the Required Items

  1. Add how many items you'd like to the items.lua file. You can use the items defined below as an example.
  2. Edit label, weight, and description with appropriate values for the items according to your needs.
  3. Save the changes made to the items.lua file.

Restart the Server

  • Restart your server to apply the changes.

Test the Integration

  • Verify that the added items appear in the inventory and work as intended with the script.
  • Ensure that using the items functions correctly within the script's mechanics.

Example Items

['police_tape'] = {
    label = 'Police Tape',
    description = 'Example',
    weight = 100,
    stack = false,
    close = true,
    consume = 0,
    allowArmed = false,
    server = { export = 'div_tape.useTapeItem' } -- REQUIRED
},

['scissors'] = {
    label = 'Scissors',
    description = 'Example',
    weight = 100,
    stack = true,
    close = true,
    consume = 0,
    allowArmed = false,
    server = { export = 'div_tape.useScissorsItem' } -- REQUIRED
},

['traffic_cone'] = {
    label = 'Traffic cone',
    description = 'Example',
    weight = 100,
    stack = true,
    close = false
},

qb-inventory

Locate the Configuration File

  1. Open your server's resources folder and navigate to the qb-core directory.
  2. Inside, locate the shared/items.lua file. This file contains the definitions for all items used in the inventory.

Define the Required Items

  1. Add how many items you'd like to the items.lua file. You can use the items defined below as an example.
  2. Edit label, weight, image and description with appropriate values for the items according to your needs.
  3. Save the changes made to the items.lua file.

Restart the Server

  • Restart your server to apply the changes.

Test the Integration

  • Verify that the added items appear in the inventory and work as intended with the script.
  • Ensure that using the items functions correctly within the script's mechanics.

Example Items

police_tape = {
    name = 'police_tape',
    label = 'Police Tape',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'police_tape.png',
    unique = true,
    useable = true,
    shouldClose = true
},

scissors = {
    name = 'scissors',
    label = 'Scissors',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'scissors.png',
    unique = true,
    useable = true,
    shouldClose = true
},

traffic_cone = {
    name = 'traffic_cone',
    label = 'Traffic cone',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'traffic_cone.png',
    unique = false,
    useable = false,
    shouldClose = false
},

qs-inventory

Locate the Configuration File

  1. This step is different for each framework.
    • For ESX:
      • Open your server's resources folder and navigate to the qs-inventory directory.
    • For QB:
      • Open your server's resources folder and navigate to the qb-core directory.
  2. Inside, locate the shared/items.lua file. This file contains the definitions for all items used in the inventory.

Define the Required Items

  1. Add how many items you'd like to the items.lua file. You can use the items defined below as an example.
  2. Edit label, weight, image and description with appropriate values for the items according to your needs.
  3. Save the changes made to the items.lua file.

Restart the Server

  • Restart your server to apply the changes.

Test the Integration

  • Verify that the added items appear in the inventory and work as intended with the script.
  • Ensure that using the items functions correctly within the script's mechanics.

Example Items

police_tape = {
    name = 'police_tape',
    label = 'Police Tape',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'police_tape.png',
    unique = true,
    useable = true,
    shouldClose = true
},

scissors = {
    name = 'scissors',
    label = 'Scissors',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'scissors.png',
    unique = true,
    useable = true,
    shouldClose = true
},

traffic_cone = {
    name = 'traffic_cone',
    label = 'Traffic cone',
    description = 'Example',
    weight = 100,
    type = 'item',
    image = 'traffic_cone.png',
    unique = false,
    useable = false,
    shouldClose = false
},

tgiann-inventory

Locate the Configuration File

  1. Open your server's resources folder and navigate to the tgiann-inventory directory.
  2. Inside, locate the items/items.lua file. This file contains the definitions for all items used in the inventory.

Define the Required Items

  1. Add how many items you'd like to the items.lua file. You can use the items defined below as an example.
  2. Edit label, weight, and description with appropriate values for the items according to your needs.
  3. Save the changes made to the items.lua file.

Restart the Server

  • Restart your server to apply the changes.

Test the Integration

  • Verify that the added items appear in the inventory and work as intended with the script.
  • Ensure that using the items functions correctly within the script's mechanics.

Example Items

['police_tape'] = {
    label = 'Police Tape',
    description = 'Example',
    weight = 100,
    stack = false,
    close = true,
    consume = 0,
    allowArmed = false,
    client = { export = 'div_tape.useTapeItem' } -- REQUIRED
},

['scissors'] = {
    label = 'Scissors',
    description = 'Example',
    weight = 100,
    stack = false,
    close = true,
    consume = 0,
    allowArmed = false,
    client = { export = 'div_tape.useScissorsItem' } -- REQUIRED
},

['traffic_cone'] = {
    label = 'Traffic Cone',
    description = 'Example',
    weight = 100,
    stack = true,
    close = false,
    consume = 0,
    allowArmed = false
},