---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by KraKss.
--- DateTime: 05/07/2023 16:02
---

RegisterNetEvent("KraKss:radio:fetchPlayersInChannelResponse", function(tbl)
    radio.playersInFrequencies = tbl
end)

RegisterNetEvent("KraKss:radio:checkItemResponse", function(hasItem)
    if (hasItem) then
        radio:openMenu()
    else
        ESX.ShowNotification(radio:translate("noItem"))
    end
end)

RegisterCommand("radio", function()
    if (cfg.sql.itemNeeded) then
        TriggerServerEvent("KraKss:radio:checkItem")
    else
        radio:openMenu()
    end
end)

RegisterKeyMapping("radio", "Ouvrir la radio", "keyboard", cfg.menu.openKeybind)
