# 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>

## Remove Commands

<details>

<summary>/setgang command</summary>

go to qb-core/server/commands and comment this :&#x20;

```lua
QBCore.Commands.Add('setgang', Lang:t('command.setgang.help'), { { name = Lang:t('command.setgang.params.id.name'), help = Lang:t('command.setgang.params.id.help') }, { name = Lang:t('command.setgang.params.gang.name'), help = Lang:t('command.setgang.params.gang.help') }, { name = Lang:t('command.setgang.params.grade.name'), help = Lang:t('command.setgang.params.grade.help') } }, true, function(source, args)
    local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
    if Player then
        Player.Functions.SetGang(tostring(args[2]), tonumber(args[3]))
    else
        TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
    end
end, 'admin')
```

</details>

<details>

<summary>/gang command</summary>

go to qb-core/server/commands and comment this :&#x20;

```lua
QBCore.Commands.Add('gang', Lang:t('command.gang.help'), {}, false, function(source)
    local PlayerGang = QBCore.Functions.GetPlayer(source).PlayerData.gang
    TriggerClientEvent('QBCore:Notify', source, Lang:t('info.gang_info', { value = PlayerGang.label, value2 = PlayerGang.grade.name }))
end, 'user')
```

</details>

## Cornerselling

<details>

<summary>Add this into your radialmenu</summary>

for example : qb-radialmenu/config.lua

```lua
     {
        id = "sell-drugs",
        displayName = "Sell Drugs",
        icon = "#weed-cultivation",
        functionName = "zat-gangs:client:cornerselling",
        enableMenu = function()
            return true
        end,
     },
```

</details>

* Make sure you have the [dependencies](#dependencies) listed above installed.
* Extract the contents of the archive to your resources folder.

<details>

<summary>QB INVENTORY or PS INVENTORY</summary>

* Add item to shared items.lua

```lua
    gangtable               = { name = 'gangtable',                    label = 'Interactive Table',             weight = 100,       type = 'item',      image = 'gangtable.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Interactive Table' }, 
    gangcamera              = { name = 'gangcamera',                   label = 'Security Camera',               weight = 100,       type = 'item',      image = 'gangcamera.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Security Camera' }, 
    gangstashs              = { name = 'gangstashs',                   label = 'Small Stash',                   weight = 100,       type = 'item',      image = 'gangstashs.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Small Stash' }, 
    gangstashm              = { name = 'gangstashm',                   label = 'Medium Stash',                   weight = 100,       type = 'item',     image = 'gangstashm.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Medium Stash' },  
    rfid_cloner             = { name = 'rfid_cloner',                  label = 'RFID Cloner',                   weight = 100,       type = 'item',      image = 'rfid_cloner.png',                                          unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'RFID Cloner' },   
    spray                   = { name = 'spray',                        label = 'Spray Bottle',                   weight = 100,       type = 'item',     image = 'spray.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Spray Bottle' }, 
    sprayc                   = { name = 'sprayc',                        label = 'Spray Remover',                   weight = 100,       type = 'item',     image = 'sprayc.png',                                                unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Spray Remover' },
```







</details>

<details>

<summary>OX INVENTORY</summary>

* Add items to ox\_inventory/data/items.lua

<pre class="language-lua"><code class="lang-lua"><strong>	["gangtable"] = {
</strong>		label = "Interactive Table",
		weight = 100,
		stack = false,
		close = true,
		description = "Interactive Table",
		client = {
			image = "gangtable.png",
		}
	},

	["spray"] = {
		label = "Spray Bottle",
		weight = 100,
		stack = false,
		close = true,
		description = "Spray Bottle",
		client = {
			image = "spray.png",
		}
	},

	["sprayc"] = {
		label = "Spray Cleaner",
		weight = 100,
		stack = false,
		close = true,
		description = "Spray Cleaner",
		client = {
			image = "sprayc.png",
		}
	},

	["gangstashs"] = {
		label = "Small Stash",
		weight = 100,
		stack = false,
		close = true,
		description = "Small Stash",
		client = {
			image = "gangstashs.png",
		}
	},
	["gangstashm"] = {
		label = "Medium Stash",
		weight = 100,
		stack = false,
		close = true,
		description = "Medium Stash",
		client = {
			image = "gangstashm.png",
		}
	},
	["rfid_cloner"] = {
		label = "RFID Cloner",
		weight = 100,
		stack = false,
		close = true,
		description = "RFID Cloner",
		client = {
			image = "rfid_cloner.png",
		}
	},
	["gangcamera"] = {
		label = "Security Camera",
		weight = 100,
		stack = false,
		close = true,
		description = "Security Camera",
		client = {
			image = "gangcamera.png",
		}
	},

</code></pre>

* Add this into ox\_inventory/modules/itmes/client.lua

```lua
-- gang script
-- if you need to change the props for ox, change them from here and from the config.lua
local GangProps = {
    ['table'] = {
        item = 'gangtable',
        prop = 'prop_gang_table',
    },
    ['camera'] = {
        item = 'gangcamera',
        prop = 'prop_cctv_cam_01a',
    },
	['stashs'] = {
        item = 'gangstashs',
        prop = 'prop_gang_basket_s',
        remove = true, -- removes the hack item after useage or not
    },
    ['stashm'] = {
        item = 'gangstashm',
        prop = 'prop_gang_basket_m',
        remove = true, -- removes the hack item after useage or not
    },
}

Item('gangtable', function(data, slot)
	TriggerEvent('zat-gangs:client:PreviewProp', "gangtable", GangProps['table'].prop)
end)

Item('gangcamera', function(data, slot)
	TriggerEvent('zat-gangs:client:PreviewProp', "gangcamera", GangProps['camera'].prop)
end)

Item('gangstashs', function(data, slot)
	TriggerEvent('zat-gangs:client:PreviewProp', "gangstashs", GangProps['stashs'].prop)
end)

Item('gangstashm', function(data, slot)
	TriggerEvent('zat-gangs:client:PreviewProp', "gangstashm", GangProps['stashm'].prop)
end)

Item('spray', function(data, slot)
	TriggerEvent('zat-gangs:client:CheckSprayData', true)
end)

Item('sprayc', function(data, slot)
	TriggerEvent('zat-gangs:client:CheckSprayData', false)
end)
```

* Add the images inside your ox\_inventory/web/images.

</details>

<details>

<summary>QS INVENTORY</summary>

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

```lua
    
    ['gangtable']             = {
        ['name'] = 'gangtable',
        ['label'] = 'Interactive Table',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'gangtable.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Interactive Table...'
    },
    ['spray']             = {
        ['name'] = 'spray',
        ['label'] = 'Spray Bott',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'spray.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Spray Bott...'
    },
    ['sprayc']             = {
        ['name'] = 'sprayc',
        ['label'] = 'Spray Cleaner',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'sprayc.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Spray Cleaner...'
    },
    ['gangstashs']             = {
        ['name'] = 'gangstashs',
        ['label'] = 'Small Stash',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'gangstashs.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Small Stash...'
    },
    ['gangstashm']             = {
        ['name'] = 'gangstashm',
        ['label'] = 'Medium Stash',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'gangstashm.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Medium Stash...'
    },
    ['rfid_cloner']             = {
        ['name'] = 'rfid_cloner',
        ['label'] = 'RFID Clone',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'rfid_cloner.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'RFID Clone...'
    },
    ['gangcamera']             = {
        ['name'] = 'gangcamera',
        ['label'] = 'Security Camer',
        ['weight'] = 50,
        ['type'] = 'item',
        ['image'] = 'gangcamera.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = true,
        ['combinable'] = nil,
        ['description'] = 'Security Camer...'
    },
```

* Add the code below into qs-inventory/server/custom/misc/createuseableitems.lua:

```lua
-- gang script
-- if you need to change the props for qs, change them from here and from the config.lua
local GangProps = {
    ['table'] = {
        item = 'gangtable',
        prop = 'prop_gang_table',
    },
    ['camera'] = {
        item = 'gangcamera',
        prop = 'prop_cctv_cam_01a',
    },
	['stashs'] = {
        item = 'gangstashs',
        prop = 'prop_gang_basket_s',
        remove = true, -- removes the hack item after useage or not
    },
    ['stashm'] = {
        item = 'gangstashm',
        prop = 'prop_gang_basket_m',
        remove = true, -- removes the hack item after useage or not
    },
}

CreateUsableItem('gangtable', function(source, item)
    local src = source
	local item = GetItemByName(src, 'gangtable')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:PreviewProp', src, "gangtable", GangProps['table'].prop)
    end
end)

CreateUsableItem('gangcamera', function(source, item)
    local src = source
	local item = GetItemByName(src, 'gangcamera')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:PreviewProp', src, "gangcamera", GangProps['camera'].prop)
    end
end)

CreateUsableItem('gangstashs', function(source, item)
    local src = source
	local item = GetItemByName(src, 'gangstashs')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:PreviewProp', src, "gangstashs", GangProps['stashs'].prop)
    end
end)

CreateUsableItem('gangstashm', function(source, item)
    local src = source
	local item = GetItemByName(src, 'gangstashm')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:PreviewProp', src, "gangstashm", GangProps['stashm'].prop)
    end
end)

CreateUsableItem('spray', function(source, item)
    local src = source
	local item = GetItemByName(src, 'spray')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:CheckSprayData', src, true)
    end
end)

CreateUsableItem('sprayc', function(source, item)
    local src = source
	local item = GetItemByName(src, 'sprayc')
    if item ~= nil then
        TriggerClientEvent('zat-gangs:client:CheckSprayData', src, false)
    end
end)
```

* Add the images inside your qs\_inventory/html/images.



</details>

## Ensure Resources

* [ ] ensure zat-gizmo
* [ ] ensure zat-gizmo\_ui
* [ ] ensure zat-gangs\_props
* [ ] ensure zat-spray
* [ ] ensure zat-gangs
