CORE inventory

STEP 1

GO TO core_inventory/config.lua

and add this on ItemCategories

    ["uniqueItem"] = {
        color = "#62a859",
        takeSound = 'take_fabric',
        putSound = 'put_fabric',
    },

    ["moduleRadio"] = {
        color = "#62a859",
        takeSound = 'take_fabric',
        putSound = 'put_fabric',
        stack = 2
    },

STEP 2 ADD THE ITEMS

Select your framework and add the items.

INSERT INTO items (name, label, weight, category) VALUES 
('radio', 'Radio', 10, 'uniqueItem'), 
('radio_red', 'Color frame red', 10, 'moduleRadio'), 
('radio_blue', 'Color frame blue', 10, 'moduleRadio'), 
('radio_purple', 'Color frame purple', 10, 'moduleRadio'), 
('radio_pink', 'Color frame pink', 10, 'moduleRadio'), 
('radio_lightblue', 'Color frame lightblue', 10, 'moduleRadio'), 
('radio_orange', 'Color frame orange', 10, 'moduleRadio'), 
('radio_yellow', 'Color frame yellow', 10, 'moduleRadio'), 
('radio_green', 'Color frame green', 10, 'moduleRadio'), 
('radio_white', 'Color frame white', 10, 'moduleRadio'), 
('radio_grey', 'Color frame grey', 10, 'moduleRadio'),
('bat_low', 'Cheap battery', 10, 'moduleRadio'),
('bat_medium', 'Common battery', 10, 'moduleRadio'),
('bat_high', 'Premium battery', 10, 'moduleRadio'),
('chip_5g', '5G Chip', 10, 'moduleRadio'),
('chip_ghost', 'Ghost Chip', 10, 'moduleRadio'),
('chip_antihack', 'Antihack Chip', 10, 'moduleRadio'),
('mic_walkie', 'Talkie Shoulder Microphone', 10, 'moduleRadio'),

('hack_chip', 'Hack chip', 10, 'moduleRadio'),

('radio_server', 'Server', 10, 'uniqueItem'),
('radio_monitor', 'Monitor of hospital', 10, 'uniqueItem'),
('radio_server_bat', 'Car battery', 10, 'uniqueItem'),
('radio_cables', 'Cables for battery', 10, 'uniqueItem'),
('radio_jammer', 'Radio Jammer', 10, 'uniqueItem'),
('radio_powerbank', 'Portable battery', 10, 'uniqueItem'),
('radio_tool', 'Radio tools', 10, 'uniqueItem'),
('radio_broken', 'Broken radio', 10, 'uniqueItem'),
('chip_waterproof', 'Waterproof radio', 10, 'uniqueItem'),

STEP 3

GO TO core_inventory/config.lua

Add the radio item on CloseAfterUse ~ line 25

CloseAfterUse = {'lockpick', 'phone', 'radio'},  

STEP 4

GO TO core_inventory/server/metadata.lua

elseif itemData['name'] == 'radio' then
	local radioST = exports['stRadio']:CreateRadio(false, false, true)
	info.id = radioST.id
        info.prop = radioST.prop
	info.alias = radioST.alias
	info.currentFreq = radioST.currentFreq
	info.freqFav = radioST.freqFav
	info.freqLast = radioST.freqLast
	info.password = radioST.password
	info.modules = radioST.modules
	info.favs = radioST.favs
	info.secure = radioST.secure
	info.battery = radioST.battery
	info.api = radioST.api
elseif itemData['name'] == 'bat_low' then
	info.batLevel = exports['stRadio']:CreateBattery(10, 100)
elseif itemData['name'] == 'bat_medium' then
	info.batLevel = exports['stRadio']:CreateBattery(10, 100)
elseif itemData['name'] == 'bat_high' then
	info.batLevel = exports['stRadio']:CreateBattery(10, 100)
elseif itemData['name'] == 'radio_powerbank' then
	info.battery = 100
elseif itemData['name'] == 'radio_jammer' then
	info.battery = exports['stRadio']:GetJammerTime()
end

Last updated

Was this helpful?