From af983cb8eb630c874e93c29afc0124fe63a11349 Mon Sep 17 00:00:00 2001 From: Mats <84041457+matsaaaaa@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:50:54 +0200 Subject: [PATCH 1/2] Added getPlayerChannels method with export --- fivem_script/tokovoip_script/src/c_main.lua | 5 +++++ 1 file changed, 5 insertions(+) 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); From 03ce113326d92b4ede9b5904d4758e406384fee5 Mon Sep 17 00:00:00 2001 From: Mats <84041457+matsaaaaa@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:52:52 +0200 Subject: [PATCH 2/2] Added documentation for getPlayerChannels export --- fivem_script/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)