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 can use it with all the data stored in it.
How do you use unique phones?
To use unique phones, you need one of the following inventories:
ox_inventory - Recommended
How do you 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.Item.UniquePhones = true
Config.Item.Require = true
How do you set up unique phones with your inventory?
The script will auto-detect your inventory. However, you can set the inventory explicitly in /config/config.lua
.
qb-inventory
Go to
qb-inventory/server/main.lua
inside the functionlocal function AddItem(source, item, amount, slot, info):173
, add the following code: Location Preview
if exports["yseries"]:VerifyPhoneItemName(item) then
TriggerClientEvent('yseries:phone-item-added', source)
end
Go to
qb-inventory/server/main.lua
and find the lineslot = tonumber(slot)
inside the functionlocal function RemoveItem(source, item, amount, slot):230
, add the following code: Location Preview
if exports["yseries"]:VerifyPhoneItemName(item) then
TriggerClientEvent('yseries:phone-item-removed', source)
end
qb-inventory v2.0 and above
Go to
qb-inventory/server/functions.lua
at the end of the functionlocal function AddItem(source, item, amount, slot, info):567
, add the following code: Location Preview
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 functionlocal function RemoveItem(source, item, amount, slot):685
, add the following code: Location Preview
if exports["yseries"]:VerifyPhoneItemName(item) then
TriggerClientEvent('yseries:phone-item-removed', source)
end
custom inventory
An inventory with metadata is sufficient, but not all inventories are supported by default. If your inventory is unsupported, you can review the existing integrations and adapt one to fit your inventory. Please note that this process requires coding expertise, and we do not provide assistance for adding custom inventories.
Phone Items
You need to add the useable items for Unique Phones.
Use the items according to your phone version - YSeries, YPhone, or YFlip Phone. For YSeries, use all.
-- Default
phone = { name = 'phone', label = 'Phone', weight = 700, type = 'item', image = 'yflip_graphite.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'yphone or maybe yflip?' },
-- YPhone
yphone_natural = { name = 'yphone_natural', label = 'YPhone Natural', weight = 700, type = 'item', image = 'yphone_natural.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'YPhone? Cuz Y not.' },
yphone_black = { name = 'yphone_black', label = 'YPhone Black', weight = 700, type = 'item', image = 'yphone_black.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'YPhone? Cuz Y not.' },
yphone_white = { name = 'yphone_white', label = 'YPhone White', weight = 700, type = 'item', image = 'yphone_white.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'YPhone? Cuz Y not.' },
yphone_blue = { name = 'yphone_blue', label = 'YPhone Blue', weight = 700, type = 'item', image = 'yphone_blue.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'YPhone? Cuz Y not.' },
-- YFlip Phone
yflip_mint = { name = 'yflip_mint', label = 'YFlip Mint', weight = 700, type = 'item', image = 'yflip_mint.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Flip it.. won\'t break' },
yflip_gold = { name = 'yflip_gold', label = 'YFlip Gold', weight = 700, type = 'item', image = 'yflip_gold.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Flip it.. won\'t break' },
yflip_graphite = { name = 'yflip_graphite', label = 'YFlip Graphite', weight = 700, type = 'item', image = 'yflip_graphite.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Flip it.. won\'t break' },
yflip_lavender = { name = 'yflip_lavender', label = 'YFlip Lavender', weight = 700, type = 'item', image = 'yflip_lavender.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Flip it.. won\'t break' },
-- YSeries only(won't work for other versions)
y24_black = { name = 'y24_black', label = 'Y24 Black', weight = 700, type = 'item', image = 'y24_black.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Y not use the Ultra?' },
y24_silver = { name = 'y24_silver', label = 'Y24 Silver', weight = 700, type = 'item', image = 'y24_silver.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Y not use the Ultra?' },
y24_yellow = { name = 'y24_yellow', label = 'Y24 Yellow', weight = 700, type = 'item', image = 'y24_yellow.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Y not use the Ultra?' },
y24_violet = { name = 'y24_violet', label = 'Y24 Violet', weight = 700, type = 'item', image = 'y24_violet.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Y not use the Ultra?' },
yphone_fold_black = { name = 'yphone_fold_black', label = 'YPhone Fold Black', weight = 700, type = 'item', image = 'yphone_fold_black.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Unfold the full experience' },
yfold_black = { name = 'yfold_black', label = 'YFold Black', weight = 700, type = 'item', image = 'yfold_black.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Unfold the full experience' },
-- Default
["phone"] = {
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
}
},
-- YPhone
["yphone_natural"] = {
label = "YPhone Natural",
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
}
},
["yphone_black"] = {
label = "YPhone Black",
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
}
},
["yphone_white"] = {
label = "YPhone White",
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
}
},
["yphone_blue"] = {
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
}
},
-- YFlip Phone
["yflip_mint"] = {
label = "YFlip Mint",
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
}
},
["yflip_gold"] = {
label = "YFlip Gold",
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
}
},
["yflip_graphite"] = {
label = "YFlip Graphite",
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
}
},
["yflip_lavender"] = {
label = "YFlip Lavender",
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
}
},
-- YSeries only(won't work for other versions)
["y24_black"] = {
label = "Y24 Black",
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
}
},
["y24_silver"] = {
label = "Y24 Silver",
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
}
},
["y24_violet"] = {
label = "Y24 Violet",
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
}
},
["y24_yellow"] = {
label = "Y24 Yellow",
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
}
},
["yfold_black"] = {
label = "YFold Black",
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
}
},
["yphone_fold_black"] = {
label = "YPhone Fold Black",
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
}
},
Last updated