diff --git a/fivem_script/README.md b/fivem_script/README.md index 12de683f..afe1f6df 100644 --- a/fivem_script/README.md +++ b/fivem_script/README.md @@ -52,6 +52,10 @@ If the channel name contains 'Call' it will be displayed as a call on the ingame Id of the radio channel + +- ### getPlayerChannels() + + Returns a list of the players currently connected radio channels - ### isPlayerInChannel(channel) @@ -73,7 +77,6 @@ If the channel name contains 'Call' it will be displayed as a call on the ingame - ### clientRequestUpdateChannels() Requests to update the local radio channels - - ### setPlayerData(playerName, key, data, shared) diff --git a/fivem_script/tokovoip_script/src/c_main.lua b/fivem_script/tokovoip_script/src/c_main.lua index 0084e7c5..e1e544ee 100644 --- a/fivem_script/tokovoip_script/src/c_main.lua +++ b/fivem_script/tokovoip_script/src/c_main.lua @@ -369,6 +369,10 @@ AddEventHandler("TokoVoip:onPlayerJoinChannel", function(channelId, playerServer end end) +function getPlayerChannels() + return voip.myChannels +end + function isPlayerInChannel(channel) if (voip.myChannels[channel]) then return true; @@ -420,5 +424,6 @@ end) -- Make exports available on first tick exports("addPlayerToRadio", addPlayerToRadio); exports("removePlayerFromRadio", removePlayerFromRadio); +exports("getPlayerChannels", getPlayerChannels); exports("isPlayerInChannel", isPlayerInChannel); exports("setRadioVolume", setRadioVolume);