Implementing esx_voice into healthbarUI

I am trying to implement esx_voice into the [Discontinued] Healthbar / UI - Now Supports vRP and ESX! (V 1.1). I would like it so it has a different width according to the players voice proximity (whisper, normal, shout).

I have tried adding the following into the proper files but seems to not change anything in the progress bar.

__resource.lua

dependencies {
	'esx_voice'
}

ui.js

ped = GetPlayerPed(-1)
proximity = NetworkGetTalkerProximity()
if (proximity == 5.0) {
    /* normal */
    $("#boxVoice").css("width","100%")
}
if (proximity == 12.0) {
    /* shout */
    $("#boxVoice").css("width","60%")
}
if (proximity == 1.0) {
    /* whisper */
    $("#boxVoice").css("width","20%")
}

ui.html

<div id="voice">
    <div id="boxVoice"></div>
</div>
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.