[Release] mumble-voip, rp-radio

As I read this topic people still struggling. Iโ€™ll try to help a bit.

If you want to make Radio an Item that you can buy from shops, you must have a script that triggers! That way you just implement the code in there and vola.

Therefore If you donโ€™t have and or you want a quick way, follow along:

Firstly go into:

rp-radio/client.lua and make sure Its says this 	{ Has = false, }

Then obviously you need an Item so go into your database and make that shit. Make sure its โ€œradioโ€ or import this into your database. radio.sql

After that download this: :point_down:

Then go to: :point_down:

esx_extraitems/client/main.lua { line: 498 } 

Add this:

RegisterNetEvent('mumble:onRadio')
AddEventHandler('mumble:onRadio', function()
	local playerPed = GetPlayerPed(-1)

	TriggerClientEvent('Radio.Set', source, true)
	TriggerClientEvent('Radio.Toggle', source)
end)

And:

esx_extraitems/server/main.lua { line: 182 }

Add this:

ESX.RegisterUsableItem('radio', function(source)
	local xPlayer = ESX.GetPlayerFromId(source)
  	TriggerClientEvent('Radio.Set', source, true)
	TriggerClientEvent('Radio.Toggle', source)
        -- xPlayer.removeInventoryItem('radio', 1)
end)

Keybinds to use radio in game use your rp-radio/config.lua settings. When you are in server use /giveitem yourid radio 1 to activate it use it from your inventory.

Done, thereโ€™s no simpler way to explain this, I know people ainโ€™t no master heads at dev, maybe needs more explanation so I hope I helped you out. :wink: Give yourself a tap on the shoulder. :clap:

6 Likes