acscripts/ac_radio

Access without job

xrtw opened this issue · 18 comments

xrtw commented

Hey, nice looking radio UI!
restrictedChannels = {
[1] = 'police',
}

I can still join this radio 1Mhz while working not in police. Did I made something wrong?

xrtw commented

Fixed by your PR in pma-voice

Fixed by your PR in pma-voice

Yes, but it's just an UI issue. People on the channel can't hear you, but you see that you are connected to it.

xrtw commented

Fixed by your PR in pma-voice

Yes, but it's just an UI issue. People on the channel can't hear you, but you see that you are connected to it.

They can't hear me, but can I listen to them?

They can't hear me, but can I listen to them?

No, the server state is correct so you're not on the radio for other players.
Just the pma-voice UI doesn't update, so only you see that you're still connected.

This PR fixed it so you can apply the changes or wait for the maintainer to hopefully merge it.

xrtw commented

Well, just tried.. So it doesn't show that you are in that radio, but you can still talk or listen when you press several times to speak on radio.

Well, just tried.. So it doesn't show that you are in that radio, but you can still talk or listen when you press several times to speak on radio.

Good point. I've sent another commit to the pma-voice PR.

xrtw commented

Well, just tried.. So it doesn't show that you are in that radio, but you can still talk or listen when you press several times to speak on radio.

Good point. I've sent another commit to the pma-voice PR.

Also, with exports['pma-voice']:getPlayersInRadioChannel(channel) it still show on that radio list with exact radio MHz even not joining it correctly.

Also, with exports['pma-voice']:getPlayersInRadioChannel(channel) it still show on that radio list with exact radio MHz even not joining it correctly.

Make sure you have the latest pma-voice release with all my changes. You can download the exact source code here.

RegisterCommand('getRadioPlayers', function(_, args)
	local channel = tonumber(args[1]) or 1
	local players = exports['pma-voice']:getPlayersInRadioChannel(channel)
	print(json.encode(players, {indent=true}))
end)

Try to connect to any available channel and then run the command above. You will see that there is one player on the channel.
After that, try to connect to a unavailable channel. You will not see any players on that channel.

xrtw commented

Also if player is dead, he can still hear what's talking on radio

Also if player is dead, he can still hear what's talking on radio

This isn't related to this resource.
You can disconnect him from the radio in your death management script using the following snippet.

exports.ac_radio:leaveRadio()
xrtw commented

hey
ESX ->
restrictedChannels = {
[1] = 'police',} players working in police can not join channel. Using your pma-voice edited version

p.s. ac_radio started after pma-voice resource and before ox_inventory

Make sure not to restart the resource - or reconnect/change character after doing so.
I will work on hot-reload later.

xrtw commented

Make sure not to restart the resource - or reconnect/change character after doing so. I will work on hot-reload later.

In main server I don't restart anything..
In test server I need to restart ac_radio to work. If not working, I have to reset my job - then it works again.

Start the resource after pma-voice and ox_inventory.

Also, the pma-voice fix was merged, so you can download the official latest release.

Make sure to keep ac_radio up to date.

xrtw commented

Start the resource after pma-voice and ox_inventory.

Also, the pma-voice fix was merged, so you can download the official latest release.

Make sure to keep ac_radio up to date.

Ty. Not it's better. But now if I go to channel 1.1 while not being in police, I can still join. But in channel 1.0 - no

How does your restrictedChannels table in config.lua look like?

xrtw commented

How does your restrictedChannels table in config.lua look like?

[1] = police
so all channels should be locked for police? as it was in readme