k0tt0m4n Posted July 31, 2015 Share Posted July 31, 2015 Hi Community , can someone help me doing a local Voice Chat Ressource or does anyone have it already?It would be very nice of you if you'd post it here . k0tt0m4n Link to comment
GTX Posted July 31, 2015 Share Posted July 31, 2015 https://wiki.multitheftauto.com/wiki/Resource:Voice - If you find anything useful. getDistanceBetweenPoints3D setPlayerVoiceBroadcastTo https://wiki.multitheftauto.com/wiki/OnPlayerVoiceStart https://wiki.multitheftauto.com/wiki/OnPlayerVoiceStop EDIT: local nearbyPlayers = {} addEventHandler("onPlayerVoiceStart", root, function() local r = 20 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 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now