v10networkscom / saltychat-fivem

FiveM implementation of Salty Chat (TeamSpeak 3 based Voice Plugin)
https://gaming.v10networks.com
GNU General Public License v3.0
70 stars 64 forks source link

ls-radio #28

Closed GroofyTV closed 3 years ago

GroofyTV commented 3 years ago

in the console he shows me this : The Specified value ''channel'' cannot be parsed, or ist out of range. (@ls-radio/html/ui.html:22)

this Scrip: https://github.com/BlackFlash5/ls-radio

client.lua : RegisterNUICallback('joinRadio', function(data, cb) local _source = source local PlayerData = ESX.GetPlayerData(_source) local playerName = GetPlayerName(PlayerId()) local getPlayerRadioChannel = exports.saltychat:GetRadioChannel(true)

if data.channel ~= getPlayerRadioChannel then if tonumber(data.channel) <= Config.RestrictedChannels then if(PlayerData.job.name == 'police' or PlayerData.job.name == 'ambulance' or PlayerData.job.name == 'fire') then exports.saltychat:SetRadioChannel(data.channel, true)

    exports['mythic_notify']:DoHudText('inform', Config.messages['joined_to_radio'] .. data.channel .. '.00 MHz </b>')
  elseif not (PlayerData.job.name == 'police' or PlayerData.job.name == 'ambulance' or PlayerData.job.name == 'fire') then
    exports['mythic_notify']:DoHudText('error', Config.messages['restricted_channel_error'])
  end
end
if tonumber(data.channel) > Config.RestrictedChannels then
  exports.saltychat:SetRadioChannel(data.channel, true)

  exports['mythic_notify']:DoHudText('inform', Config.messages['joined_to_radio'] .. data.channel .. '.00 MHz </b>')
end

else exports['mythic_notify']:DoHudText('error', Config.messages['you_on_radio'] .. data.channel .. '.00 MHz ') end

-- Debug output --[[ PrintChatMessage("radio: " .. data.channel) print('radiook') ]]

cb('ok') end)

nasuaclara commented 3 years ago

Just change the channel input value to "" (html/ui.html) image

GroofyTV commented 3 years ago

Ändern Sie einfach den Kanaleingabewert in "" (html / ui.html). Bild

in what should I change him?

GroofyTV commented 3 years ago

And now i have : Error invoking callback for event SaltyChat_IsSending: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object at SaltyServer.RadioChannel.Send (SaltyServer.VoiceClient voiceClient, System.Boolean isSending) [0x0005f] in C:\Users\Timmy\Desktop\saltychat-fivem-master\saltychat\SaltyServer\Radio.cs:104 at SaltyServer.VoiceManager.OnSendingOnRadio (CitizenFX.Core.Player player, System.String radioChannelName, System.Boolean isSending) [0x00037] in C:\Users\Timmy\Desktop\saltychat-fivem-master\saltychat\SaltyServer\VoiceManager.cs:347 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003b] in <4fffd39960df419684f9b9cb5ce46688>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00051] in <4fffd39960df419684f9b9cb5ce46688>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <4fffd39960df419684f9b9cb5ce46688>:0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <4fffd39960df419684f9b9cb5ce46688>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <4fffd39960df419684f9b9cb5ce46688>:0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <4fffd39960df419684f9b9cb5ce46688>:0 at CitizenFX.Core.EventHandlerEntry.Invoke (System.String sourceString, System.Object[] args) [0x00064] in /src/code/client/clrcore/EventHandlerDictionary.cs:89