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:
- Open your
server.cfgfile. - Copy and paste the line below into the file to configure the ignored weapons for your inventory system:
setr inventory:ignoreweapons ["WEAPON_BALL"] - Save the file after adding this line.
Locate the Configuration File
- Open your server's resources folder and navigate to the
ox_inventorydirectory. - Inside, locate the
data/items.luafile. This file contains the definitions for all items used in the inventory.
Define the Required Items
- Add how many items you'd like to the
items.luafile. You can use the items defined below as an example. - Edit
label,weight, anddescriptionwith appropriate values for the items according to your needs. - Save the changes made to the
items.luafile.
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
- Open your server's resources folder and navigate to the
qb-coredirectory. - Inside, locate the
shared/items.luafile. This file contains the definitions for all items used in the inventory.
Define the Required Items
- Add how many items you'd like to the
items.luafile. You can use the items defined below as an example. - Edit
label,weight,imageanddescriptionwith appropriate values for the items according to your needs. - Save the changes made to the
items.luafile.
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
- This step is different for each framework.
- For ESX:
- Open your server's resources folder and navigate to the
qs-inventorydirectory.
- Open your server's resources folder and navigate to the
- For QB:
- Open your server's resources folder and navigate to the
qb-coredirectory.
- Open your server's resources folder and navigate to the
- For ESX:
- Inside, locate the
shared/items.luafile. This file contains the definitions for all items used in the inventory.
Define the Required Items
- Add how many items you'd like to the
items.luafile. You can use the items defined below as an example. - Edit
label,weight,imageanddescriptionwith appropriate values for the items according to your needs. - Save the changes made to the
items.luafile.
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
- Open your server's resources folder and navigate to the
tgiann-inventorydirectory. - Inside, locate the
items/items.luafile. This file contains the definitions for all items used in the inventory.
Define the Required Items
- Add how many items you'd like to the
items.luafile. You can use the items defined below as an example. - Edit
label,weight, anddescriptionwith appropriate values for the items according to your needs. - Save the changes made to the
items.luafile.
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
},