Git Product home page Git Product logo

interact-sound's Introduction

Interact Sound

Play sounds using the NUI environment in FiveM's FXServer.

interact-sound's People

Contributors

bulgarpl avatar oaaron99 avatar patriksletmo avatar plunkettscott avatar the-neco avatar tinky124 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

interact-sound's Issues

Cut sound

Hi, i was doing some testing and i'm having the following problem:

i'm using
TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 20, 'demo', 1.0)
and having it get called with a chatcommand and key press, but the sound always gets cut immediately after it starts, then i tested it inside a car and the sound played without any problems, i then called a friend to join the server to see if he would hear the cut sound too, tested it all again:

Outside of the car: Both of us got the sound cut
Inside of the car: Both of us got the sound cut
One inside and one outside of the car: I was inside and could hear the sound without any problems but my friend heard it cut...

Any ideas what could be happening?

Curious on progress

Has the playOnEntity been updated so it will fade out from how far away you are from the sound? Been looking for this feature with interact-sound.

Different names of events

In the latest versione available right now, the server side of the script triggering the wrong client events:
Server triggers "InteractSound_SV:PlayOnAll" but client has "LIFE_CL:Sound:PlayOnAll"

onesync infinity not working

When trying to use onesync infinity all players can here sound when its played

TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 4.0, 'demo', 0.1)

Also tried to remove the if statement to use original or onesync to only

RegisterServerEvent('InteractSound_SV:PlayWithinDistance')
AddEventHandler('InteractSound_SV:PlayWithinDistance', function(maxDistance, soundFile, soundVolume)

TriggerClientEvent('InteractSound_CL:PlayWithinDistanceOS', -1, GetEntityCoords(GetPlayerPed(source)), maxDistance, soundFile, soundVolume)
end)

doesn't work

can someone send me an example with a command that it play a sound.

Seatbelt sound not working

in resource: SeatbeltIndicator i have put this:
TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 0.5, 'demo', 1.0)
for testing the demo sound and that is not working..

resource name voor the interact sound is: interact-sound

can you help me?

MF Trackable issues / adding new sounds issue

I struggle adding a new sound this is my fxmanifest

files {
    'client/html/index.html',
    -- Begin Sound Files Here...
    -- client/html/sounds/ ... .ogg
    'client/html/sounds/demo.ogg'
    'client/html/sounds/alert.ogg'
},

Interact-Sound and xsound issue

I bought the GKSPhone, and took the interact-sound sound folder and dropped it into the xsound html folder inside the gksphone and now my sounds for seatbelt clicks, cuffing and such isnt working, can you help me?

Documentation is broken/missing

The documentation linked to in the repo - https://plunkettscott.github.io/interact-sound/start/ - seems to be broken for me. The only page displayed is the "Getting Started" page and the first sentence is cut off with nothing else following;

Interact Sound is easy to install and use. To install it, simply fetch the latest release from

It appears the documentation linked in the original CitizenFX Forums - https://plunkettscott.gitbooks.io/scott-s-script-documentation/content/scripts/interactsound.html - is still working.

question

please help me over here

so if i want the sound to play if the player is close to a center area

what should i change here

RegisterNetEvent('InteractSound_CL:PlayWithinDistance')
AddEventHandler('InteractSound_CL:PlayWithinDistance', function(playerNetId, maxDistance, soundFile, soundVolume)
local lCoords = GetEntityCoords(GetPlayerPed(-1))
local eCoords = GetEntityCoords(GetPlayerPed(GetPlayerFromServerId(playerNetId)))
local distIs = Vdist(lCoords.x, lCoords.y, lCoords.z, eCoords.x, eCoords.y, eCoords.z)
if(distIs <= maxDistance) then
SendNUIMessage({
transactionType = 'playSound',
transactionFile = ENTER.ogg,
transactionVolume = 1.0
})
end
end)

lets say the audio should start playing when a player is close to this cords

1311.6092529297,625.64227294922,80.577026367188
where do i put it and from where can i change the max distance ?

sorry i'm still learning

Only "demo" ogg works

Only the demo ogg works. When i add a new ogg file, it wont work. I addded it in the resource but nothing happens. The file i added is only 3 seconds as well.

audioPlayer.pause() issue

Hi,

When I want to play a sound nothing plays, well I think it's playing but it pauses before you can actually hear something I think.

When I remove:

if (audioPlayer != null) {
audioPlayer.pause();
}

Then the sound plays but after a amount of use of the player with several sounds it gets crackling and after that it stops totally playing any sound.
Looks like a overstack of the sounds.
Is there a way to improve the audioPlayer.pause() so it only pauses when the file is done playing or no sound is triggered?

Thank you in advance.

onesync infinity support

Hey so when running onesync infinity people can hear the sounds all over the map

it works completly fine on normal onesync

Everyone can hear sound, but i want only a certain job to hear it

I want to make it so only police hear the sound when receiving a notification.. but everyone on the server receive it even tho it's in a loop.. anyone can help ?

    local source = source
    local xPlayer = ESX.GetPlayerFromId(source)
    local Players = ESX.GetPlayers()

    for i = 1, #Players do
        local xPlayer = ESX.GetPlayerFromId(Players[i])

        if xPlayer["job"]["name"] == "police" then
        	TriggerClientEvent('InteractSound_CL:PlayOnOne', xPlayer.source, 'dispatch', 0.1)           
        end
    end 

Question

Is there a way we could loop like 3 seconds long audios for x interactions?
like

if Config.PlaySoundEffects then
     TriggerServerEvent("InteractSound_SV:PlayOnSource", "scott", 0.6) -- maybe add a way to make the audio loop?
end

I've tried looping the sound many times but it doesn't seem to work quite right.

PlayWithinDistance no longer working?

No matter what I've tried. I cannot get 0.5 version sounds to play within distance.
It plays across the entire server no matter what. (OneSync enabled) for example I'm using polspeak resource

TriggerServerEvent("InteractSound_SV:PlayWithinDistance", 20.0, "bcso_disperse", 0.6)

My sound ends up playing across entire server no matter what I do. As if PlayOnAll is being used even though its not.

load issue

keep getting cant load resource interact-sound

Play multip sounds

Feature request
Its possible to play multip sounds once sound1 played wait little bit than play anouther sound ?

Here is my client.lua

--Zombie sounds
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(5000)
        for i, entity in pairs(entitys) do
	       	playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
			pedX, pedY, pedZ = table.unpack(GetEntityCoords(entity, true))
			if IsPedDeadOrDying(entity, 1) == 1 then
				--none :v
			else
				if(Vdist(playerX, playerY, playerZ, pedX, pedY, pedZ) <= 10.0 ) then

					TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 5.0, "groan3", 1.0)

				end
			end
		end
	end
end)

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.