Jump to content

Local voice chat


Tekken

Recommended Posts

I wouldn't bother, the voice resource needs significant updating.

I once made a resource for it which let you create rooms, and only people within the rooms would hear one another. But the volume of that voice resource is so ridiculously quiet - it's practically of no use whatsoever.

Unless they've fixed it since I brought it up :lol:

Link to comment
I wouldn't bother, the voice resource needs significant updating.

I once made a resource for it which let you create rooms, and only people within the rooms would hear one another. But the volume of that voice resource is so ridiculously quiet - it's practically of no use whatsoever.

Unless they've fixed it since I brought it up :lol:

Your resource is exactly wath i need.., you have ti now ?

Link to comment

i tried like this:

addEventHandler ( "onClientPlayerVoiceStart", root, 
    function() 
        local voice_range = 50 
        local distance = getDistanceBetweenPoints3D (camX, camY, camZ, headX, headY, headZ) 
        if distance <= voice_range then 
            voicePlayers[source] = true 
        end 
    end     
) 

  • Like 1
Link to comment

it's not correct simply because u didn't add camX , CamY , camY , headX, headY , headY more than that i think SkatCh got confused between Draw voice image and the voice.

it can be like this:

local voice_range = 50 
  
addEventHandler ( "onClientPlayerVoiceStart", root, 
    function() 
       if (source and isElement(source) and getElementType(source) == "player") then 
        local sX, sY, sZ = getElementPosition(localPlayer) 
        local rX, rY, rZ = getElementPosition(source) 
        local distance = getDistanceBetweenPoints3D(sX, sY, sZ, rX, rY, rZ) 
        if distance <= voice_range then 
            voicePlayers[source] = true 
        end 
     end 
  end     
)  

Link to comment

Try

  
local voice_range = 50 
  
addEventHandler ( "onClientPlayerVoiceStart", root, 
    function() 
       if (source and isElement(source) and getElementType(source) == "player") and localPlayer ~= source then 
        local sX, sY, sZ = getElementPosition(localPlayer) 
        local rX, rY, rZ = getElementPosition(source) 
        local distance = getDistanceBetweenPoints3D(sX, sY, sZ, rX, rY, rZ) 
        if distance <= voice_range then 
            voicePlayers[source] = true 
        end 
     end 
  end     
)  
  

Link to comment

Now nowbody can hear me

local range = 50 
  
addEventHandler ( "onClientPlayerVoiceStart", root, 
function() 
    if (source and isElement(source) and getElementType(source) == "player") and localPlayer ~= source then 
        local sX, sY, sZ = getElementPosition(localPlayer) 
        local rX, rY, rZ = getElementPosition(source) 
        local distance = getDistanceBetweenPoints3D(sX, sY, sZ, rX, rY, rZ) 
        if distance <= range then 
            voicePlayers[source] = true 
        else 
            voicePlayers[source] = nil 
        end 
    end 
end     
) 

Link to comment

Found it, thank you guys for the support :D

local range = 50 
  
addEventHandler ( "onClientPlayerVoiceStart", root, 
function() 
    if (source and isElement(source) and getElementType(source) == "player") and localPlayer ~= source then 
        local sX, sY, sZ = getElementPosition(localPlayer) 
        local rX, rY, rZ = getElementPosition(source) 
        local distance = getDistanceBetweenPoints3D(sX, sY, sZ, rX, rY, rZ) 
        if distance <= range then 
            voicePlayers[source] = true 
        else 
            cancelEvent()--This was the shit 
        end 
    end 
end 
) 

Link to comment
  • 2 years later...
  • 4 months later...
10 hours ago, Resmurf said:

I know it's old, but i'm trying to i mean they said they achieved it which i highly doubt because all the servers would be flooded with voice chats.

  
local nearbyPlayers = {} 
  
addEventHandler("onPlayerVoiceStart", root, 
    function() 
        local r = 50 
        local posX, posY, posZ = getElementPosition(source) 
        local chatSphere = createColSphere(posX, posY, posZ, r) 
        nearbyPlayers = getElementsWithinColShape(chatSphere, "player") 
        destroyElement(chatSphere) 
        local empty = exports.voice:getNextEmptyChannel() 
        exports.voice:setPlayerChannel(source, empty) 
        for index, player in ipairs(nearbyPlayers) do 
            exports.voice:setPlayerChannel(player, empty) 
        end 
    end 
) 
addEventHandler("onPlayerVoiceStop", root, 
    function() 
        exports.voice:setPlayerChannel(source) 
        for index, player in ipairs(nearbyPlayers) do 
            exports.voice:setPlayerChannel(player) 
        end 
        nearbyPlayers = {} 
    end 
) 

 

  • Like 1
Link to comment
  • 1 year later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...