Biyei Scripts

Exports

openRadioclient

Opens the radio menu (respects Config.RequireItem).

toggleRadioclient

Opens or closes the radio menu.

isOnRadioclient

Whether the player is connected to a frequency right now.

Returns: boolean

isPoweredclient

Whether the radio is turned on.

Returns: boolean

isTransmittingclient

Whether the player is transmitting (PTT pressed) right now.

Returns: boolean

getFrequencyclient

The current frequency.

Returns: number|nil

getVolumeclient

Current volume.

Returns: number (0-100)

isStreamerclient

Whether streamer mode is active.

Returns: boolean

isAnonymousclient

Whether anonymous mode is active.

Returns: boolean

getMembersclient

Last received member list: { {id, name, talking, isSelf, anon}, ... }.

Returns: table

getStateclient

Full state snapshot (power, connected, frequency, transmitting, volume, anonymous, streamer, animation, sound, members).

Returns: table

setPowerclient

Turns the radio on or off.

ParamTypeDescription
onboolean
setFrequencyclient

Turns the radio on if needed and joins the given frequency. Respects Config.RequireItem via the server.

ParamTypeDescription
freqnumber
Lua
-- Put the player on frequency 101.5 from another script
exports['biyei_radio']:setFrequency(101.5)
leaveRadioclient

Leaves the current frequency.

isPlayerOnRadioserver

Whether the player is on any frequency.

ParamTypeDescription
srcnumber

Returns: boolean

getPlayerFrequencyserver

The player's current frequency.

ParamTypeDescription
srcnumber

Returns: number|nil

getPlayersInFrequencyserver

Members of a frequency.

ParamTypeDescription
freqnumber

Returns: table — { [src] = talking(boolean), ... }

setPlayerFrequencyserver

Forces a player onto a frequency (0 or nil kicks them out). Ignores the item requirement.

ParamTypeDescription
srcnumber
freqnumber

Returns: boolean

Lua
-- Put every on-duty cop on frequency 500
RegisterNetEvent('cops:onDuty', function()
    exports['biyei_radio']:setPlayerFrequency(source, 500)
end)
removePlayerFromRadioserver

Removes a player from their frequency.

ParamTypeDescription
srcnumber
getIntegrationserver

Returns the auto-detected framework and inventory.

Returns: table — { framework, inventory }

Lua
local info = exports['biyei_radio']:getIntegration()
print(info.framework, info.inventory)