# Installation



## Dependencies :

<details>

<summary>QBCore</summary>

You will need the latest version of [qb-core](https://github.com/qbcore-framework/qb-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 :&#x20;

<details>

<summary>QB INVENTORY</summary>

Add the items below to the qb-core/shared/items.lua:&#x20;

```lua
    printer                             = { name = 'printer',           label = 'Printer',      weight = 100, type = 'item', image = 'printer.png',     unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    document                            = { name = 'document',          label = 'Document',     weight = 100, type = 'item', image = 'document.png',    unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    camera                              = { name = 'camera',            label = 'Camera',       weight = 100, type = 'item', image = 'camera.png',      unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    photo                               = { name = 'photo',             label = 'Photo',        weight = 100, type = 'item', image = 'photo.png',       unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    photo_album                         = { name = 'photo_album',       label = 'Photo Album',        weight = 100, type = 'item', image = 'photo_album.png',       unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    document_folder                     = { name = 'document_folder',   label = 'Document Folder',        weight = 100, type = 'item', image = 'document_folder.png',       unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
    envelope                            = { name = 'envelope',            label = 'Envelope ',        weight = 100, type = 'item', image = 'envelope.png',       unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
```

</details>

<details>

<summary>QS INVENTORY</summary>

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

```lua
['printer'] = {
    ['name'] = 'printer',
    ['label'] = 'Printer',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'printer.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['document'] = {
    ['name'] = 'document',
    ['label'] = 'Document',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'document.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['camera'] = {
    ['name'] = 'camera',
    ['label'] = 'Camera',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'camera.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['photo'] = {
    ['name'] = 'photo',
    ['label'] = 'Photo',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'photo.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['photo_album'] = {
    ['name'] = 'photo_album',
    ['label'] = 'Photo Album',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'photo_album.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['document_folder'] = {
    ['name'] = 'document_folder',
    ['label'] = 'Document Folder',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'document_folder.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},
['envelope'] = {
    ['name'] = 'envelope',
    ['label'] = 'Envelope ',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'envelope.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = ''
},

```

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

<pre class="language-lua"><code class="lang-lua">local PrinterItems = {
    printer     = {
        item = "printer",
        prop = "v_res_printer",
    },
    document    = {
        item = "document",
        prop = nil,
    },
    camera    = {
        item = "camera",
        prop = nil,
    },
    photo    = {
        item = "photo",
        prop = nil,
    },
    photo_album = {
        item = "photo_album",
        prop = nil,
    },
    document_folder = {
        item = "document_folder",
        prop = nil,
    },
    envelope = {
        item = "envelope",
        prop = nil,
    },
}

CreateUsableItem(PrinterItems.printer.item, function(source, item)
    local src = source
    TriggerClientEvent('zat-printer:client:PreviewProp', src, PrinterItems.printer.item, PrinterItems.printer.prop)
<strong>end)
</strong>CreateUsableItem(PrinterItems.camera.item, function(source, item)
    local src = source
    TriggerClientEvent('zat-printer:client:OpenCamera', src)
end)
CreateUsableItem(PrinterItems.document.item, function(source, item)
    local src = source
    TriggerClientEvent("zat-printer:client:PreviewDocument", src, item.info)
end)
CreateUsableItem(PrinterItems.photo.item, function(source, item)
    local src = source
    TriggerClientEvent("zat-printer:client:PreviewPhoto", src, item.info)
end)
CreateUsableItem(PrinterItems.photo_album.item, function(source, item)
    local src = source
    local data = {
        info = item.info, 
        slot = item.slot
    }
    TriggerClientEvent("zat-printer:client:OpenPhotoAlbum", src, data)
end)
CreateUsableItem(PrinterItems.document_folder.item, function(source, item)
    local src = source
    local data = {
        info = item.info, 
        slot = item.slot
    }
    TriggerClientEvent("zat-printer:client:OpenFolder", src, data)
end)
CreateUsableItem(PrinterItems.envelope.item, function(source, item)
    local src = source
    local data = {
        info = item.info, 
        slot = item.slot
    }
    TriggerClientEvent("zat-printer:client:OpenEnvelope", src, data)
end)
</code></pre>

</details>

<details>

<summary>OX INVENTORY</summary>

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

```lua
["printer"] = {
    label = "Printer",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "printer.png",
    }
},
["document"] = {
    label = "Document",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "document.png",
    }
},
["camera"] = {
    label = "Camera",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "camera.png",
    }
},
["photo"] = {
    label = "Photo",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "photo.png",
    }
},
["photo_album"] = {
    label = "Photo Album",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "photo_album.png",
    }
},
["document_folder"] = {
    label = "Document Folder",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "document_folder.png",
    }
},
["envelope"] = {
    label = "Envelope ",
    weight = 100,
    stack = false,
    close = true,
    description = "",
    client = {
        image = "envelope.png",
    }
},

```

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

```lua
local PrinterItems = {
    printer     = {
        item = "printer",
        prop = "v_res_printer",
    },
    document    = {
        item = "document",
        prop = nil,
    },
    camera    = {
        item = "camera",
        prop = nil,
    },
    photo    = {
        item = "photo",
        prop = nil,
    },
    photo_album = {
        item = "photo_album",
        prop = nil,
    },
    document_folder = {
        item = "document_folder",
        prop = nil,
    },
    envelope = {
        item = "envelope",
        prop = nil,
    },
}

Item(PrinterItems.printer.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            TriggerEvent('zat-printer:client:PreviewProp', PrinterItems.printer.item, PrinterItems.printer.prop)
        end
    end)
end)

Item(PrinterItems.camera.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            TriggerEvent('zat-printer:client:OpenCamera')
        end
    end)
end)


Item(PrinterItems.document.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            TriggerEvent("zat-printer:client:PreviewDocument", slot.metadata)
        end
    end)
end)

Item(PrinterItems.photo.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            TriggerEvent("zat-printer:client:PreviewPhoto", slot.metadata)
        end
    end)
end)
Item(PrinterItems.photo_album.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            local data = {
                info = slot.metadata, 
                slot = slot.slot
            }
            TriggerEvent("zat-printer:client:OpenPhotoAlbum", data)
        end
    end)
end)
Item(PrinterItems.document_folder.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            local data = {
                info = slot.metadata, 
                slot = slot.slot
            }
            TriggerEvent("zat-printer:client:OpenFolder", data)
        end
    end)
end)

Item(PrinterItems.envelope.item, function(data, slot)
    ox_inventory:useItem(data, function(data)
        if data then
            local data = {
                info = slot.metadata, 
                slot = slot.slot
            }
            TriggerEvent("zat-printer:client:OpenEnvelope", data)
        end
    end)
end)
```



</details>

## ENSURE RESOURCES

* [ ] ensure zat-gizmo\_ui
* [ ] ensure zat-gizmo
* [ ] ensure zat-printer
