Custom inventory

Replace CustomInventory with the name of your inventory

Add to Config.lua

Config.CustomInventory = GetResourceState("CustomInventory") == 'started'

Create files

Create CustomInventory.lua file in gksphone/server/inventory and gksphone/client/inventory folders

  • When the phone item is deleted, the "gksphone:client:ItemRemoved" trigger must be fired. ( If your inventory does not support this feature, check other inventory files. )

  • It should work when the "UsePhoneItem" export phone element is used

  • β€” If there is no export support in the inventory, you can run it using server-side framework structures. ( Use RegisterUsableItem in ESX and CreateUseableItem in Qb-core )

if not Config.CustomInventory then return end

RegisterNetEvent("gksphone:client:ItemRemoved", function(item)
    Wait(500)
    if PhoneUniqueId and lastItemData and lastItemData.name == item then
        ItemPhoneDeleted()
    end
end)

exports("UsePhoneItem", function(data, itemData)
    --data = {name = 'phone', label = 'Phone', slot = 1, count = 1}
    --itemData = {name = 'phone', slot = 1, metadata = {phoneID = 'GKS202501HM1D', eSIMNumber = '28946041', phoneLang = 'en'}}
    TriggerEvent("gksphone:client:usePhone", data.name, itemData)
end)

Last updated