🦄Unique phones

What are unique phones?

A phone is bound to a phone item, not to a character. Every phone is like a physical phone and can be used with all stored data. You can give your phone to another player and they will be able to use it with all data stored in it.

How to use unique phones?

To have unique phones, you need one of the following inventories:

How to enable unique phones?

To enable unique phones you need to set Config.Item.UniquePhones and Config.Item.Require to true in /config/config.lua.

/config/config.lua
Config.Item.UniquePhones = true
Config.Item.Require = true

How to add unique phones to your inventory?

ox_inventory

Make sure to set Config.Item.Inventory to ox_inventory in /config/config.lua.

/config/config.lua
Config.Item.Inventory = "ox_inventory"

You need to register the phone items to your ox_inventory. You can do it by adding the following code to your inventory ox_inventory/data/items.lua.

Register the following items based on the phone system you're using - YFlip Phone, YPhone or YSeries(bundle). All items should have the same body, you need to repeat it for each. Or you can use the included items in the downloaded package.

ox_inventory/data/items.lua

["phone"] = ...

-- YPhone
["yphone"] = ...
["yphone_natural"] = ...
["yphone_black"] = ...
["yphone_white"] = ...
["yphone_blue"] = ...

-- YFlip Phone
["yflipphone"] = ...
["yflip_mint"] = ...
["yflip_gold"] = ...
["yflip_graphite"] = ...
["yflip_lavender"] = ...

-- Y24
["y24_black"] = ...
["y24_silver"] = ...
["y24_violet"] = ...
["y24_yellow"] = ...

-- YFold
["yfold_black"] = ...

-- YPhone Fold
["yphone_fold_black"] = ...

Replace ... with the code block below

ox_inventory/data/items.lua
{
    label = "Phone",
    weight = 100,
    stack = false,
    consume = 0,
    client = {
        export = "yseries.UsePhoneItem",
        remove = function()
            TriggerEvent("yseries:phone-item-removed")
        end,
        add = function()
            TriggerEvent("yseries:phone-item-added")
        end
    }
},

qb-inventory

Make sure to set Config.Item.Inventory to qb-inventory in /config/config.lua. Also you need to modify your [phone] item in qb-core/shared/items.lua, set useable and shouldClose to true.

/config/config.lua
Config.Item.Inventory = "qb-inventory"
  • Go to qb-inventory/server/main.lua inside the function local function AddItem(source, item, amount, slot, info):173, add the following code: Location Preview

qb-inventory/server/main.lua:173
if exports["yseries"]:VerifyPhoneItemName(item) then
    TriggerClientEvent('yseries:phone-item-added', source)
end
  • Go to qb-inventory/server/main.lua and find the line slot = tonumber(slot) inside the function local function RemoveItem(source, item, amount, slot):230, add the following code: Location Preview

qb-inventory/server/main.lua:230
if exports["yseries"]:VerifyPhoneItemName(item) then
    TriggerClientEvent('yseries:phone-item-removed', source)
end

qb-inventory v2.0.0 and above

Make sure to set Config.Item.Inventory to qb-inventory in /config/config.lua. Also you need to modify your [phone] item in qb-core/shared/items.lua, set useable and shouldClose to true.

/config/config.lua
Config.Item.Inventory = "qb-inventory"
  • Go to qb-inventory/server/functions.lua at the end of the function local function AddItem(source, item, amount, slot, info):567, add the following code: Location Preview

qb-inventory/server/functions.lua:668
if exports["yseries"]:VerifyPhoneItemName(item) then
    TriggerClientEvent('yseries:phone-item-added', source)
end
  • Go to qb-inventory/server/functions.lua at the end of the function local function RemoveItem(source, item, amount, slot):685, add the following code: Location Preview

qb-inventory/server/functions.lua:230
if exports["yseries"]:VerifyPhoneItemName(item) then
    TriggerClientEvent('yseries:phone-item-removed', source)
end

lj-inventory

  • Follow the steps for qb-inventory and set Config.Item.Inventory to lj-inventory in /config/config.lua.

ps-inventory

  • Follow the steps for qb-inventory and set Config.Item.Inventory to ps-inventory in /config/config.lua.

codem-inventory

  • Set Config.Item.Inventory to codem-inventory in /config/config.lua.

tgiann-inventory

  • Set Config.Item.Inventory to tgiann-inventory in /config/config.lua.

core-inventory

Set Config.Item.Inventory to core-inventory in /config/config.lua.

Last updated