Monteiro Posted April 6, 2023 Share Posted April 6, 2023 (edited) Quero saber como colocar virgula no dinheiro da minha hud, ela é compartilhada e não consigo colocar a virgula. Quero implementar a virgula ai me ajuda? Ex dela: global local = { design = { {'image', 'bg', 1138, 57, 205, 45, 0, 0, 0, 190}, {'image', 'health', 1150, 64, 12, 12, 255, 255, 255, 255}, {'imagem', 'armadura', 1151, 81, 10, 12, 255, 255, 255, 255}, {'imagem', ' energia', 1232, 81, 7, 13, 255, 255, 255, 255}, {'imagem', 'barra', 1171, 68, 160, 6, 0, 0, 0, 220}, {'imagem', 'bar2', 1171, 84, 53, 6, 0, 0, 0 , 220 }, {'imagem', 'bar3', 1245, 84, 86, 6, 0, 0, 0, 220}, {'image', 'location', 1335, 25, 8, 10, 255, 255, 255, 255}, {'image', 'time', 1334, 39, 9, 9, 255, 255, 255, 255 }, }; } addEventHandler('onClientRender', getRootElement( ), function ( ) local x, y, z = getElementPosition(localPlayer) local time = getRealTime() local hours = time.hour local minutes = time.minute local day = time.monthday local monthh = time.month if (hours < 10) then hours = "0"..hours end if (minutes < 10) then minutes = "0"..minutes end if (day < 10) then day = "0"..day end if (monthh < 10) then monthh = "0"..monthh end for _, v in pairs ( Global.design ) do if v[1] == 'image' then dxDrawImage(v[3], v[4], v[5], v[6], 'assets/images/'..v[2]..'.png', 0, 0, 0, tocolor(v[7], v[8], v[9], v[10])) dxDrawImage(1325, 110, 16, 16, 'assets/images/dinheiro.png', 0, 0, 0, tocolor(255, 255, 255, 50)) dxDrawImage(1246, 36, 17, 16, 'assets/images/voice.png', 0, 0, 0, tocolor(255, 255, 255, 50)) dxDrawImage(1227, 77, 16, 16, 'assets/images/comida.png', 0, 0, 0, tocolor(255, 255, 255, 50)) end end dxDrawImageSection(1171, 68, (160 * getElementHealth(localPlayer)/100), 6, 0, 0, (160 * getElementHealth(localPlayer)/100), 6, 'assets/images/bar.png', 0, 0, 0, tocolor(config.gerais.colorHealth[1], config.gerais.colorHealth[2], config.gerais.colorHealth[3], 255)) dxDrawImageSection(1171, 84, (53 * getPedArmor(localPlayer)/100), 6, 0, 0, (53 * getPedArmor(localPlayer)/100), 6, 'assets/images/bar2.png', 0, 0, 0, tocolor(config.gerais.colorArmor[1], config.gerais.colorArmor[2], config.gerais.colorArmor[3], 255)) dxDrawImageSection(1245, 84, (86 * (getElementData(localPlayer, config.gerais.dataHungry) or 50)/100), 6, 0, 0, (86 * (getElementData(localPlayer, config.gerais.dataHungry) or 50)/100), 6, 'assets/images/bar3.png', 0, 0, 0, tocolor(config.gerais.colorHungry[1], config.gerais.colorHungry[2], config.gerais.colorHungry[3], 255)) dxDrawText(''..getZoneName ( x, y, z )..' - '..getZoneName ( x, y, z, true )..'', 1210, 25, 121, 12, tocolor(255, 255, 255, 255), 1, getFont('Poppins-SemiBold', 10), 'right', 'center') dxDrawText(''..day..'/'..monthh..' - '..hours..':'..minutes..'', 1210, 10, 121, 70, tocolor(255, 255, 255, 255), 1, getFont('Poppins-SemiBold', 10), 'right', 'center') dxDrawText('R$: '..getPlayerMoney(localPlayer)..'', 1270, 116, 50, 12, tocolor(255, 255, 255, 255), 1, getFont('Poppins-SemiBold', 11), 'direita', 'centro') fim) Edited April 6, 2023 by xLive fix format Link to comment
Scripting Moderators xLive Posted April 6, 2023 Scripting Moderators Share Posted April 6, 2023 Welcome to the forums @Monteiro. Your thread has been moved to the Portuguese section. Please use this section in the future. Link to comment
Doongogar Posted April 7, 2023 Share Posted April 7, 2023 On 06/04/2023 at 19:49, Monteiro said: Quero saber como colocar virgula no dinheiro da minha hud, ela é compartilhada e não consigo colocar a virgula. Quero implementar a virgula ai me ajuda? Ex dela: Expand você pode usar a função util: formatNumber ela está escrita na wiki e também tem um exemplo de como usa-lá 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