Coder Social home page Coder Social logo

acscripts / ac_radio Goto Github PK

View Code? Open in Web Editor NEW
54.0 1.0 29.0 881 KB

Simple and framework-standalone radio UI for pma-voice.

Home Page: https://forum.cfx.re/t/4846739

License: GNU General Public License v3.0

Lua 77.92% HTML 5.82% JavaScript 7.32% CSS 8.94%
fivem esx qbcore roleplay ox qbox

ac_radio's People

Contributors

achrafvod avatar antond15 avatar crazioz avatar crowguy5 avatar kevinl852 avatar nuga-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ac_radio's Issues

QBCore source problem

I'm getting this error. any clue?
I have the latest pma and your ac

[    script:pma-voice] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:1016: bad argument #1 to 'format' (number expected, got nil)
[    script:pma-voice] > handleStateBagInitilization (@pma-voice/server/main.lua:16)
[    script:pma-voice] > defaultTable (@pma-voice/server/main.lua:6)
[    script:pma-voice] > ref (@pma-voice/server/module/radio.lua:91)
[    script:pma-voice] > onLoaded (@ac_radio/resource/server/players.lua:10)
[    script:pma-voice] > handler (@ac_radio/resource/server/players.lua:27)
[    script:pma-voice] > CreatePlayer (@qb-core/server/player.lua:441)
[    script:pma-voice] > CheckPlayerData (@qb-core/server/player.lua:138)
[    script:pma-voice] > ref (@qb-core/server/player.lua:24)
[    script:pma-voice] > rawExecute (@oxmysql/dist/build.js:21878)
[    script:pma-voice] > processTicksAndRejections (node:internal/process/task_queues:96)
[     script:ac_radio] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:841: An error occurred while calling export setPlayerRadio of resource pma-voice
[     script:ac_radio] nil

Bug:

Version

latest from github

Issue description

image

I havent changed the locale and its not working on any languages i tried :/

Steps to reproduce

  1. Download newest version
  2. Restart ressource
  3. Restart server
  4. Still broken :/

Bug: Item can not be used

Version

1.0.8

Issue description

When you have the radio item in ox_inventory and qb-core it gives an error and doesnt do anything

Steps to reproduce

  1. get a radio item
  2. use it via ox_inventory
  3. see error

Distance effects and battery

Feature description

Add, if you’re ever further away from the people on the radio, the radio starts to rustle and stop until at the end, when someone speaks, it’s just a rustle.

The second option is to add batteries to the radio of course not for groups with factions like: police, medicine

Reason

I think it’s a cool addition to RolePlay

Bug: Restricted Radio Channels

Version

latest (1.0.8)

Framework

es_extended

Issue description

I need help abt Restrict Radio Channels coz its not working on my side.

Config (Restrict Side)
-- Number of available frequencies.
maximumFrequencies = 1000,

-- How much the frequency value can change per step.
frequencyStep = 0.01,

-- Channel frequency restrictions.
restrictedChannels = {
	[1] = 'police',
	[2] = {
		ambulance = 0      
	},
	[3] = {
		mechanic = 0      
	},
	[4] = {
		police = 0,
		ambulance = 0
	},
	[5] = {
		police = 0,
		mechanic = 0
	},
},

Direct Vid: https://streamable.com/ztojnh

Steps to reproduce

Nothing, just fix this please. Thank you

Confirm the following statements:

  • This issue is not a question or a feature request.
  • I have provided a detailed issue description and detailed reproduction steps.

Bug: FPS drop extremly on talking

Version

1.0.7 (newest)

Issue description

whenever i press talk key the FPS drop from 60 to 15 fps for a second, it hapens to everybody on the server, i use esx legacy with overextended and pma voice

Steps to reproduce

  1. Connect a channel
  2. Try to talk

Bug: Volume Increase and Decrease Not Fully Functioning

Version

v1.1.0

Framework

ox_core

Issue description

When a player uses the volume up or volume down buttons, it does not increase or decrease the overall volume of the radio. When using the volume up button it will set the volume to ten as opposed to adding then to the current volume.

Current Code Block

resource > client > client.lua

RegisterNUICallback('volume_up', function()
	local volume = volumeState or voice:getRadioVolume()

	if volumeState then
		volumeState = nil
		notify('inform', locale('volume_unmute'), 1000)
	end

	if volume <= 90 then
		volume += 10
		voice:setRadioVolume(volume)
		notify('inform', locale('volume_up', math.floor(volume)), 1500, 'volume-high')
	else
		notify('error', locale('volume_max'), 2500)
	end
end)

RegisterNUICallback('volume_down', function()
	local volume = volumeState or voice:getRadioVolume()

	if volumeState then
		volumeState = nil
		notify('inform', locale('volume_unmute'), 1000)
	end

	if volume >= 20 then
		volume -= 10
		voice:setRadioVolume(volume)
		notify('inform', locale('volume_down', math.floor(volume)), 1500, 'volume-low')
	else
		notify('error', locale('volume_min'), 2500)
	end
end)

The local volume variable is being created within the function as opposed to being global meaning that it essentially resets every function call.

Suggested Change

resource > client > client.lua

local volume = volumeState or voice:getRadioVolume()
RegisterNUICallback('volume_up', function()
	if volumeState then
		volumeState = nil
		notify('inform', locale('volume_unmute'), 1000)
	end

	if volume <= 90 then
		volume += 10
		voice:setRadioVolume(volume)
		notify('inform', locale('volume_up', math.floor(volume)), 1500, 'volume-high')
	else
		notify('error', locale('volume_max'), 2500)
	end
end)

RegisterNUICallback('volume_down', function()
	if volumeState then
		volumeState = nil
		notify('inform', locale('volume_unmute'), 1000)
	end

	if volume >= 20 then
		volume -= 10
		voice:setRadioVolume(volume)
		notify('inform', locale('volume_down', math.floor(volume)), 1500, 'volume-low')
	else
		notify('error', locale('volume_min'), 2500)
	end
end)

Instead of creating the local volume variable within the function, it is instead creating it outside the function making its value not coupled on the function's existence.

Steps to reproduce

  1. Install the resource along with pma-voice and do the required configuration for pma-voice
  2. Open up FiveM and use the key set to open the radio
  3. Talk to a friend using the radio without using the volume up button
  4. After talking to that friend, try using the volume up button, after using it, your friend should sound more quiet

ac_radio config.lua

ac = {
	-- Language for notifications and UI
	locale = 'en',

	-- Whether to check for newer resource version and notify in server console.
	versionCheck = true,

	-- Whether to use custom notification function.
	useCustomNotify = true,

	-- Whether to use command for opening the radio UI.
	useCommand = true,

	-- Default keybind for the '/radio' command.
	commandKey = 'F7',

	-- Whether to disconnect from radio when there is no radio item in player's inventory.
	noRadioDisconnect = true,

	-- Number of available frequencies.
	maximumFrequencies = 5000,

	-- How much the frequency value can change per step.
	frequencyStep = 0.01,

	-- Channel frequency restrictions.
	restrictedChannels = {
		
	},

	-- ! The following options will override the pma-voice convars.
	-- Whether to enable radio submix (voice sounds like on real radio).
	radioEffect = true,

	-- Whether to enable animation while talking on radio.
	radioAnimation = true,

	-- Default keybind for talking on radio.
	radioKey = 'COMMA',
}

PMA Voice Config

setr voice_useNativeAudio true
setr voice_useSendingRangeOnly true
setr voice_enableRadios 1
setr voice_enableRadioAnim 1

Confirm the following statements:

  • This issue is not a question or a feature request.
  • I have provided a detailed issue description and detailed reproduction steps.

Info: Restricted channels doesn't work

  1. pma-voice issue
    The server state is correct so you're not on the radio for other players - they can't hear you and you can't hear them.
    There is currently a pending PR in pma-voice that fixes this issue. Until it gets hopefully merged, you can apply the changes manually.

    Download the latest pma-voice release to fix this issue.

  2. ac_radio issue
    This could happen after restarting the resource while on server.
    Player jobs gets updated after selecting a character and/or changing them (eg. setting a new job).
    This will be fixed in the coming days.

    Download the latest ac_radio release to fix this issue.

Access without job

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?

Bug: Can't Move Mouse

Version

v1.0.2

Framework

es_extended

Issue description

When i open the radio i can't move my mouse and its stuck in the middle of the screen

Steps to reproduce

  1. Resource Restart
  2. Reinstalled

Confirm the following statements:

  • This issue is not a question or a feature request.
  • I have provided a detailed issue description and detailed reproduction steps.

Usable items

i understand you can do /radio will you get it to work on use. keep up the great work.

Enhancement: Radio Jammer or Radio signal lost

Feature description

Radio jamer:

to jam radio signal of specific player job with specific distance
so this way radio connection of players in the specified area will be lost, but only players on the specific area other players who connected with different area wont lost their conection.

OR

Signal lost:

If players move away from their HQ, the signal gradually weakens. After reaching a specific distance, they lose signal on their radios, preventing communication with other players on the same frequency. However, players equipped with an item like an 'antenna' can extend their signal range and communicate with others on that radio frequency. Upon signal loss, include a notification or sound effect to alert players. Additionally, consider implementing durability for the 'antenna' to add an element of resource management.

I apologize for my limited English. If you need more details or explanations about this request, I am happy to provide them.

Reason

I'm suggesting this feature for FiveM servers to make the game more realistic and strategic. By simulating radio signal limitations, we can introduce challenges that promote teamwork and planning among players. This applies not only to city RP servers but also to any server with a simulation RP theme.

Bug: Radio UI opens automatically

Version

v1.2.0

Framework

es_extended

Issue description

When I switch the windows from the FiveM window to another window and then I get back to the FiveM one, the radio UI shows up without having set any keybind, is that normal or it's a bug? Am I the only one having that bug?
Thanks

Steps to reproduce

(When ac_radio and pma-voice installed in server, of course)

  1. Switch window from the FiveM window to another one (using mouse or ALT+TAB)
  2. Get back to FiveM window, it will show up the radio UI without clicking anything

Confirm the following statements:

  • This issue is not a question or a feature request.
  • I have provided a detailed issue description and detailed reproduction steps.

Bug: Key Configuration

Version

v1.0.2

Framework

ox_core

Issue description

I installed ac-radio, the script works without problems except for one detail, I changed the basic configuration key (ALT) to Caps Lock. the problem is that not all players see their configuration change for some it works without problem, for others on the contrary it stays on the initial key and for others it goes to another key . Any idea how to fix this, I've already tried deleting the cache and the server cache

i'm on standalone no framework

Steps to reproduce

  1. Install the script
  2. test then
  3. change the key

Confirm the following statements:

  • This issue is not a question or a feature request.
  • I have provided a detailed issue description and detailed reproduction steps.

Enhancement:

Feature description

Mabye add that you need an item to use the radio and if you not have the radio item you cant open your radio

Reason

For more roleplay

Enhancement: Multiple radios at a time

Feature description

Can there be able to use 2 or more radios at a time. Like when you are at a scene, and wants to hear the ems radio and fire for command.

Reason

I think it's needed at a big scene, or internal coms and main at the same time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.