Items

In this section, we’ll guide you through configuring the Kartik-MDT items for three different inventory systems: ox_inventory ,qb-inventory and qs-inventory. Below are the item configurations you’ll need to add to your server to enable the Mobile Data Terminal (MDT), Dispatch, and Bodycam items in your inventory system.


1. ox_inventory Configuration

For ox_inventory, you need to add the following configuration in your ox_inventory/data/items.lua file.

['mdt'] = {
    label = 'Mobile Data Terminal',
    weight = 250,
    stack = true,
    consume = 0,
    close = true,
    description = "",
    client = {
        export = 'kartik-mdt.openMDT'
    }
},

['dispatch'] = {
    label = 'Dispatch',
    weight = 250,
    stack = true,
    consume = 0,
    close = true,
    description = "",
    client = {
        export = 'kartik-mdt.openDispatch'
    }
},

['bodycam'] = {
    label = 'Bodycam',
    weight = 250,
    stack = true,
    consume = 0,
    close = true,
    description = "",
    client = {
        export = 'kartik-mdt.ToggleBodycam',
         remove = function(total)
	        if total < 1 then
		    TriggerServerEvent('kartik-mdt:server:removeBodycam')
		end
	end
    }
},

['tracker'] = {
	label = 'Tracker',
	description = "The app that lets you track the whereabouts of your fellow mates.",
	weight = 100,
	consume = 0,
	client = {
		remove = function(total)
			if total < 1 then
				TriggerServerEvent('kartik-mdt:server:removePlayerBlip')
			end
		end
	},
	server = {
		export = 'kartik-mdt.useTracker'
	}
},
  • mdt: This item allows access to the Mobile Data Terminal.

  • dispatch: This item opens the Dispatch interface.

  • bodycam: This item toggles the Bodycam feature.

Each item has specific functions tied to the client-side exports (like kartik-mdt.openMDT and kartik-mdt.ToggleBodycam).

2. qb-inventory Configuration

For qb-inventory, add the following configurations in your qb-core/shared/items.lua file.

mdt = {
    name = 'mdt',
    label = 'Mobile Data Terminal',
    weight = 250,
    type = 'item',
    image = 'mdt.png',
    unique = true,
    shouldClose = true,
    description = "",
},

dispatch = {
    name = 'dispatch',
    label = 'Dispatch',
    weight = 250,
    type = 'item',
    image = 'dispatch.png',
    unique = true,
    shouldClose = true,
    description = "",
},

bodycam = {
    name = 'bodycam',
    label = 'Bodycam',
    weight = 250,
    type = 'item',
    image = 'bodycam.png',
    unique = true,
    shouldClose = true,
    description = "",
},

tracker = {
    name = 'tracker',
    label = 'GPS Tracker',
    weight = 250,
    type = 'item',
    image = 'tracker.png',
    unique = true,
    shouldClose = true,
    description = "",
},
  • mdt: Represents the Mobile Data Terminal item with an associated image (mdt.png).

  • dispatch: Represents the Dispatch item with its own image (dispatch.png).

  • bodycam: The Bodycam item, identified by the image (bodycam.png).

Each item is set as unique and has its own image file, ensuring they are displayed correctly in the inventory.

3. qs-inventory Configuration

For qs-inventory, add the following configurations in your qs-inventory/shared/items.lua file.

['mdt'] = {
    ['name'] = 'mdt',
    ['label'] = 'Mobile Data Terminal',
    ['weight'] = 250,
    ['type'] = 'item',
    ['image'] = 'mdt.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['object'] = nil,
    ['description'] = 'Access the Mobile Data Terminal system.',
    ['client'] = {
        export = 'kartik-mdt.openMDT'
    },
},

['dispatch'] = {
    ['name'] = 'dispatch',
    ['label'] = 'Dispatch',
    ['weight'] = 250,
    ['type'] = 'item',
    ['image'] = 'dispatch.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['object'] = nil,
    ['description'] = 'Dispatch interface for managing incidents.',
    ['client'] = {
        export = 'kartik-mdt.openDispatch'
    },
},

['bodycam'] = {
    ['name'] = 'bodycam',
    ['label'] = 'Bodycam',
    ['weight'] = 250,
    ['type'] = 'item',
    ['image'] = 'bodycam.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['object'] = nil,
    ['description'] = 'Activate or toggle your bodycam.',
    ['client'] = {
        export = 'kartik-mdt.ToggleBodycam'
    },
},

['tracker'] = {
    ['name'] = 'tracker',
    ['label'] = 'GPS Tracker',
    ['weight'] = 250,
    ['type'] = 'item',
    ['image'] = 'tracker.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['object'] = nil,
    ['description'] = 'The app that lets you track the whereabouts of your fellow mates.',
    ['server'] = {
        export = 'kartik-mdt.useTracker'
    },
  • mdt: Represents the Mobile Data Terminal item with an associated image (mdt.png).

  • dispatch: Represents the Dispatch item with its own image (dispatch.png).

  • bodycam: The Bodycam item, identified by the image (bodycam.png).

Each item is set as unique and has its own image file, ensuring they are displayed correctly in the inventory.


✅ Key Points to Remember:

  • Unique items: All the items (mdt, dispatch, and bodycam) are unique and should be set accordingly in the inventory system.

  • Item images: Ensure the respective image files (mdt.png, dispatch.png, bodycam.png) are placed in the correct directory for proper display in the inventory.

Note : Images are not provided by us as of now.

  • Client exports: For ox_inventory, the client-side export functions (kartik-mdt.openMDT, kartik-mdt.openDispatch, and kartik-mdt.ToggleBodycam) are tied to each item’s functionality.

By following these steps and adding the correct configurations, your MDT items will be ready for use in your Kartik-MDT system!


Last updated