Installation
Here you can find guide on how to make the radio work as usable item.
⚠️
If you are using OX Inventory with ESX or QB Core, follow the OX Inventory guide only.
OX Inventory
Add the following snippet to ox_inventory/data/items.lua
.
ox_inventory/data/items.lua
['radio'] = {
label = 'Radio',
weight = 100,
stack = true,
close = true,
client = {
export = 'ac_radio.openRadio',
remove = function(total)
-- Disconnets a player from the radio when all his radio items are removed.
if total < 1 and GetConvar('radio:disconnectWithoutRadio', 'true') == 'true' then
exports.ac_radio:leaveRadio()
end
end
}
},
For more detailed steps, visit the official Creating items guide.
ESX
Create a new item in your database. You can run the following SQL command.
Usable item will be created automatically after starting this resource.
SQL
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('radio', 'Radio', 1, 0, 1);
QB Core
The radio item will be created automatically after starting this resource.