# Installation



## Dependencies :

<details>

<summary>ES EXTENDED</summary>

You will need the latest version of  [esx\_core](https://github.com/esx-framework/esx_core).

* Extract the contents of the archive to your resources folder.

- Start the resource near the top of your resources in your server.cfg.

</details>

***

## Inventories :

<details>

<summary>QS INVENTORY</summary>

Add the items below into your qs-inventory/shared/items.lua

```lua
    -- GPS
    ['road_gps_tablet'] = {
        ['name'] = 'road_gps_tablet',
        ['label'] = 'GPS Tablet',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps_tablet.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'GPS Tablet'
    },

    ['road_gps_detector'] = {
        ['name'] = 'road_gps_detector',
        ['label'] = 'GPS Detector',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps_detector.png',
        ['unique'] = false,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'GPS Detector'
    },

    ['road_gps'] = {
        ['name'] = 'road_gps',
        ['label'] = 'GPS',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'GPS'
    },

    ['road_gps_guide'] = {
        ['name'] = 'road_gps_guide',
        ['label'] = 'GPS Label',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps_guide.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'GPS Label'
    },

    ['road_gps_ankle'] = {
        ['name'] = 'road_gps_ankle',
        ['label'] = 'GPS Ankle Bracelet',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps_ankle.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'GPS Ankle Bracelet'
    },

    ['road_gps_ankle_key'] = {
        ['name'] = 'road_gps_ankle_key',
        ['label'] = 'Ankle Monitor Removal Tool',
        ['weight'] = 100,
        ['type'] = 'item',
        ['image'] = 'road_gps_ankle_key.png',
        ['unique'] = false,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Ankle Monitor Removal Tool'
    },
```

Add this into qs-inventory/server/custom/misc/CreateUseableItem.lua

```lua
-- GPS :
local GPSITems = {                        
    gps         = 'road_gps',
    detector    = 'road_gps_detector',
    tablet      = 'road_gps_tablet',
    guide       = 'road_gps_guide',
    ankle       = 'road_gps_ankle',
    key         = 'road_gps_ankle_key',
}

CreateUsableItem(GPSITems.tablet, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseGPSTablet", src, item.info, item.slot)
end)

CreateUsableItem(GPSITems.gps, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseGPS", src, item.info, item.slot)
end)

CreateUsableItem(GPSITems.ankle, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseAnkle", src, item.info, item.slot)
end)

CreateUsableItem(GPSITems.detector, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseGPSDetector", src)
end)

CreateUsableItem(GPSITems.guide, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseGPSGuide", src, item.info)
end)

CreateUsableItem(GPSITems.key, function(source, item)
    local src = source
    TriggerClientEvent("zat-gps:client:UseAnkleRemover", src)
end)
```

Add this into qs-inventory/config/metadata.js

```javascript
        } else if (itemData.name == "road_gps_tablet") {
            $(".item-info-title").html("<p>" + label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Reference: </strong><span>" +
                itemData.info.ref +
                "</span></p>"
            );
        } else if (itemData.name == "road_gps") {
            $(".item-info-title").html("<p>" + label + "</p>");
            $(".item-info-description").html(
                "<p><strong>IP: </strong><span>" +
                itemData.info.ip +
                "</span></p><p><strong>Password: </strong><span>" +
                itemData.info.password +
                "</span></p>"
            );
        } else if (itemData.name == "road_gps_guide") {
            $(".item-info-title").html("<p>" + label + "</p>");
            $(".item-info-description").html(
                "<p><strong>IP: </strong><span>" +
                itemData.info.ip +
                "</span></p><p><strong>Password: </strong><span>" +
                itemData.info.password +
                "</span></p>"
            );
        } else if (itemData.name == "road_gps_ankle") {
            $(".item-info-title").html("<p>" + label + "</p>");
            $(".item-info-description").html(
                "<p><strong>IP: </strong><span>" +
                itemData.info.ip +
                "</span></p><p><strong>Password: </strong><span>" +
                itemData.info.password +
                "</span></p>"
            );
```

</details>

<details>

<summary>OX INVENTORY</summary>

Add the items below into your ox-inventory/data/items.lua

```lua
	["road_gps_tablet"] = {
		label = "GPS Tablet",
		weight = 100,
		stack = false,
		close = true,
		description = "GPS Tablet...",
		client = {
			image = "road_gps_tablet.png",
		}
	},
	["road_gps"] = {
		label = "GPS Chip",
		weight = 100,
		stack = false,
		close = true,
		description = "GPS Chip...",
		client = {
			image = "road_gps.png",
		}
	},
	["road_gps_detector"] = {
		label = "GPS Detector",
		weight = 100,
		stack = true,
		close = true,
		description = "GPS Detector...",
		client = {
			image = "road_gps_detector.png",
		}
	},
	["road_gps_guide"] = {
		label = "GPS Label",
		weight = 100,
		stack = false,
		close = true,
		description = "GPS Label...",
		client = {
			image = "road_gps_guide.png",
		}
	},
	["road_gps_ankle"] = {
		label = "GPS Ankle Bracelet",
		weight = 100,
		stack = false,
		close = true,
		description = "GPS Ankle Bracelet...",
		client = {
			image = "road_gps_ankle.png",
		}
	},
	["road_gps_ankle_key"] = {
		label = "Ankle Monitor Removal Tool",
		weight = 100,
		stack = true,
		close = true,
		description = "Ankle Monitor Removal Tool...",
		client = {
			image = "road_gps_ankle_key.png",
		}
	},
```

Add this into ox\_inventory/modules/items/client.lua

```lua
-- gps tracker

local GPSItems = {                        
    gps         = 'road_gps',
    detector    = 'road_gps_detector',
    tablet      = 'road_gps_tablet',
    guide       = 'road_gps_guide',
    ankle       = 'road_gps_ankle',
    key         = 'road_gps_ankle_key',
}


Item(GPSItems.tablet, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseGPSTablet", slot.metadata, slot.slot)
		end
	end)
end)

Item(GPSItems.gps, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseGPS", slot.metadata, slot.slot)
		end
	end)
end)

Item(GPSItems.ankle, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseAnkle", slot.metadata, slot.slot)
		end
	end)
end)

Item(GPSItems.detector, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseGPSDetector")
		end
	end)
end)

Item(GPSItems.guide, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseGPSGuide", slot.metadata)
		end
	end)
end)

Item(GPSItems.key, function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			TriggerEvent("zat-gps:client:UseAnkleRemover")
		end
	end)
end)
```

</details>

***

## ENSURE RESOURCES

* [ ] ensure zat-gps
