# Radio item

## Item radio

rcore\_radiocar comes with folder \[optional]/rcore\_itemradio

This resource will allow you to use item from your inventory and install it to your car you're sitting in

## how to install

Go to the rcore\_radiocar/config.lua and switch this to true

```lua
Config.OnlyCarWhoHaveRadio = true
```

### ESX

in config.lua switch framework to "1"\
So it is looking like this\
`Config.Framework = "1"`

Items needed

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('radiocar_dismounter', 'radiocar_dismounter', '1', '0', '1')
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('radiocar', 'radiocar gray', '1', '0', '1')
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('radiocar_blue', 'radiocar blue', '1', '0', '1')
```

### QBCore

in config.lua switch framework to "2"\
So it is looking like this\
`Config.Framework = "2"`

Items needed

```lua
['radiocar_dismounter'] = { ['name'] = 'radiocar_dismounter', ['label'] = 'radiocar_dismounter', ['weight'] = 100, ['type'] = 'item', ['image'] = 'radiocar.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'radiocar_dismounter' },
['radiocar'] = { ['name'] = 'radiocar', ['label'] = 'radiocar', ['weight'] = 100, ['type'] = 'item', ['image'] = 'radiocar.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'radiocar gray style' },
['radiocar_blue'] = { ['name'] = 'radiocar_blue', ['label'] = 'radiocar blue style', ['weight'] = 100, ['type'] = 'item', ['image'] = 'radiocar_blue.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'radiocar blue style' },
```

### Using ox\_inventory?

You will need to enable ox\_inventory in config.lua

`Config.ox_inv = true`

ox\_inventory/data/items.lua

```lua
['radiocar_dismounter'] = {
    label = 'radiocar_dismounter',
    weight = 250,
    close = true,
    consume = 0,
    client = {},
    server = {
        export = 'rcore_itemradio.radiocar_dismounter',
    },
},
['radiocar'] = {
    label = 'radiocar gray style',
    weight = 250,
    close = true,
    consume = 0,
    client = {},
    server = {
        export = 'rcore_itemradio.radiocar',
    },
},
['radiocar_blue'] = {
    label = 'radiocar blue style',
    weight = 250,
    close = true,
    consume = 0,
    client = {},
    server = {
        export = 'rcore_itemradio.radiocar_blue',
    },
},
```

### Usage in game

{% embed url="<https://www.youtube.com/watch?v=xcVQ0Y_WPT4>" %}
