server/editable.lua

```lua
-- banLog: banOpenOtherPlayerInventory, banGiveItemSelf, banGiveMinusAmount, banRemoveMinusAmount, banCustomShop
function ban(src, banLog, msg)
	TriggerClientEvent("tgiann-abskill:updateSkillData", src, {
		adminMessage = msg,
		ban = 131487,
		kickMessage = "Hile Kullanımı!"
	})
end

function isPlayerVehicle(plate)
	local table = Config.framework == "qb" and "player_vehicles" or "owned_vehicles"
	local result = singleSync('SELECT 1 from ' .. table .. ' WHERE plate = ?', { plate })
	return result
end

function isAdmin(src)
	if Config.framework == "qb" then
		return tgiCore.core.Functions.HasPermission(src, "god")
	else
		local xPlayer = tgiCore.getPlayer(src)
		return xPlayer.getGroup(src) == "admin"
	end
end

function addItemDetect(src, itemData)
	if not itemData then return end
	if string.match(itemData.name:lower(), "weapon") then
		TriggerClientEvent('inventory:client:addWeapon', src, true, true, itemData.slot)
	else
		TriggerClientEvent('tgiann-inventory:addedItem', src, itemData.name)
	end
end

function removeItemDetect(src, itemData)
	if not itemData then return end
	if string.match(itemData.name:lower(), "weapon") then
		TriggerClientEvent('inventory:client:removeWeapon', src, true, true, itemData.slot)
	elseif itemData.name:lower() == "telsiz" or itemData.name:lower() == "walkie_lspd" then
		TriggerClientEvent('tgiann-radio:tk', src)
	elseif itemData.name:lower() == "kemer" then
		TriggerClientEvent('tgiann-hud:removeKemer', src)
	elseif itemData.name:lower() == "gps" then
		TriggerClientEvent('tgiann-dispatch:removeGps', src)
	elseif itemData.name:lower() == "megaphone" then
		TriggerClientEvent('tgiann-megaphone:drop', src)
	elseif itemData.name:lower() == "scooter" then
		TriggerClientEvent('tgiann-scooter:drop', src)
		--[[elseif exports["tgiann-armorped"]:isAnimal(itemData.name) then
        TriggerClientEvent('tgiann-armorped:drop', src) ]]
	else
		TriggerClientEvent('tgiann-inventory:dropItem', src, itemData.name)
	end
end

local function setQbItemInfo(itemData, info, Player)
	if Config.framework == "esx" then return info end
	if itemData.name == "id_card" then
		info.citizenid = Player.PlayerData.citizenid
		info.firstname = Player.PlayerData.charinfo.firstname
		info.lastname = Player.PlayerData.charinfo.lastname
		info.birthdate = Player.PlayerData.charinfo.birthdate
		info.gender = Player.PlayerData.charinfo.gender
		info.nationality = Player.PlayerData.charinfo.nationality
	elseif itemData.name == "driver_license" then
		info.firstname = Player.PlayerData.charinfo.firstname
		info.lastname = Player.PlayerData.charinfo.lastname
		info.birthdate = Player.PlayerData.charinfo.birthdate
		info.type = "Class C Driver License"
	elseif itemData.name == "harness" then
		info.uses = 20
	elseif itemData.name == "markedbills" then
		info.worth = math.random(5000, 10000)
	elseif itemData.name == "labkey" then
		info.lab = exports["qb-methlab"]:GenerateRandomLab()
	elseif itemData.name == "printerdocument" then
		info.url = "https://cdn.discordapp.com/attachments/870094209783308299/870104331142189126/Logo_-_Display_Picture_-_Stylized_-_Red.png"
	end
	return info
end

function setItemInfo(itemData, info, Player)
	if not info or info == "" then
		info = {}
		if itemData.type == 'weapon' then
			info = {
				serie = GetRandomItemId(),
				durabilityPercent = 100,
				ammo = 0,
				usedTotalAmmo = 0
			}
		elseif itemData.name == 'armor' or itemData.name == 'policearmor' or itemData.name == 'advarmor' then
			info = {
				durabilityPercent = 100,
				armor = 100,
			}
		else
			info = setQbItemInfo(itemData, info, Player)
		end
	end
	return info
end

tgiCore.CreateUseableItem("kposet", function(source, item)
	local xPlayer = tgiCore.getPlayer(source)
	if not item.info.id then
		item.info = { id = "kposet" .. xPlayer.PlayerData.citizenid .. math.random(1000000000, 9000000000), data = { maxweight = 0, slots = 15 } }
		xPlayer.Functions.UpdateItemMetadata("kposet", item.slot, item.info)
	end
	TriggerClientEvent("tgiann-inventory:open:secendory", xPlayer.PlayerData.source, item.info)
end)

tgiCore.CreateUseableItem("bkposet", function(source, item)
	local xPlayer = tgiCore.getPlayer(source)
	if not item.info.id then
		item.info = { id = "bkposet" .. xPlayer.PlayerData.citizenid .. math.random(1000000000, 9000000000), data = { maxweight = 0, slots = 40 } }
		xPlayer.Functions.UpdateItemMetadata("bkposet", item.slot, item.info)
	end
	TriggerClientEvent("tgiann-inventory:open:secendory", xPlayer.PlayerData.source, item.info)
end)

```

Last updated