Hugo_Almeidowski Posted February 7, 2019 Share Posted February 7, 2019 How do I change these progress bars colors? healthBar = DGS:dgsCreateProgressBar(0.40, 0.93, 0.2, 0.04, true) armorBar = DGS:dgsCreateProgressBar(0.40, 0.88, 0.2, 0.04, true) function updateBars () local playerHealth = getElementHealth (localPlayer ) DGS:dgsProgressBarSetProgress(healthBar, playerHealth) local playerArmor = getPedArmor(localPlayer) DGS:dgsProgressBarSetProgress(armorBar, playerArmor) end addEventHandler ( "onClientRender", root, updateBars ) Link to comment
Scripting Moderators thisdp Posted February 8, 2019 Scripting Moderators Share Posted February 8, 2019 dgsSetProperty(progressbar,"bgColor",tocolor(r,g,b,a)) dgsSetProperty(progressbar,"indicatorColor",tocolor(r,g,b,a)) 1 Link to comment
Hugo_Almeidowski Posted February 8, 2019 Author Share Posted February 8, 2019 7 hours ago, thisdp said: dgsSetProperty(progressbar,"bgColor",tocolor(r,g,b,a)) dgsSetProperty(progressbar,"indicatorColor",tocolor(r,g,b,a)) healthBar = DGS:dgsCreateProgressBar(0.40, 0.93, 0.2, 0.04, true) dgsSetProperty(healthBar,"bgColor",tocolor(255, 0, 0, 50)) dgsSetProperty(healthBar,"indicatorColor",tocolor(0, 250, 0, 50)) armorBar = DGS:dgsCreateProgressBar(0.40, 0.88, 0.2, 0.04, true) local screenWidth, screenHeight = guiGetScreenSize ( ) function updateBars () local playerHealth = getElementHealth (localPlayer ) DGS:dgsProgressBarSetProgress(healthBar, playerHealth) local playerArmor = getPedArmor(localPlayer) DGS:dgsProgressBarSetProgress(armorBar, playerArmor) local timehour, timeminute = getTime() dxDrawText (timehour.. ":".. timeminute.. "h", 532, screenHeight - 139, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.5, "pricedown" ) end addEventHandler ( "onClientRender", root, updateBars ) It is not working. Everything below just stopped working and the bar didn't change colors Link to comment
Scripting Moderators thisdp Posted February 8, 2019 Scripting Moderators Share Posted February 8, 2019 watch your debug message. about the "DGS" perfix: DGS = exports.dgs is always used. But i recommend you to use this instead loadstring(exports.dgs:dgsImportFunction())()-- load functions label = dgsCreateLabel(0,0,0.5,0.1,"text",true) --create a label 1 Link to comment
Hugo_Almeidowski Posted February 8, 2019 Author Share Posted February 8, 2019 1 hour ago, thisdp said: watch your debug message. about the "DGS" perfix: DGS = exports.dgs is always used. But i recommend you to use this instead loadstring(exports.dgs:dgsImportFunction())()-- load functions label = dgsCreateLabel(0,0,0.5,0.1,"text",true) --create a label I don't understand what you said I have put the DGS = exports.dgs 3 minutes ago, Hugo_Almeidowski said: I don't understand what you said I have put the DGS = exports.dgs Ok I understand now, thanks. I was dumb hehehe 1 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