zRodrigoMM Posted June 28, 2020 Share Posted June 28, 2020 Alguém sabe me dizer se tem como por pontuação no dinheiro em DX ? ex: 5.000,000 e também o texto com bordas ao redor ? local Dinheiro = (getPlayerMoney(getLocalPlayer())) local Banco = getElementData(localPlayer,"Banco") or 0 local procurado = getPlayerWantedLevel(getLocalPlayer()) dxDrawText(Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawText(Dinheiro, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawText(Banco, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) Link to comment
Sucrilhex Posted June 28, 2020 Share Posted June 28, 2020 6 hours ago, zRodrigoMM said: Alguém sabe me dizer se tem como por pontuação no dinheiro em DX ? ex: 5.000,000 e também o texto com bordas ao redor ? local Dinheiro = (getPlayerMoney(getLocalPlayer())) local Banco = getElementData(localPlayer,"Banco") or 0 local procurado = getPlayerWantedLevel(getLocalPlayer()) dxDrawText(Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawText(Dinheiro, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawText(Banco, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) tente: local Dinheiro = (getPlayerMoney(getLocalPlayer())) local DinheiroF = formatNumber(Dinheiro) local Banco = getElementData(localPlayer,"Banco") or 0 local DinheiroB = formatNumber(Banco) local procurado = getPlayerWantedLevel(getLocalPlayer()) dxDrawText(Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawText(DinheiroF, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawText(DinheiroB, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) 1 2 Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 5 hours ago, Sucrilhex said: tente: local Dinheiro = (getPlayerMoney(getLocalPlayer())) local DinheiroF = formatNumber(Dinheiro) local Banco = getElementData(localPlayer,"Banco") or 0 local DinheiroB = formatNumber(Banco) local procurado = getPlayerWantedLevel(getLocalPlayer()) dxDrawText(Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawText(DinheiroF, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawText(DinheiroB, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) Não deu certo, ta dando erro no debugscript; "atemp to call global 'formatNumber'(a nil value) DUP. Link to comment
Angelo Pereira Posted June 28, 2020 Share Posted June 28, 2020 Apenas faltou : function formatNumber ( number ) local formatar = number while true do formatar, k = string.gsub(formatar, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k == 0 ) then break end end return formatar end -- .. código abaixo. 1 1 Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 (edited) 43 minutes ago, Angelo Pereira said: Apenas faltou : function formatNumber ( number ) local formatar = number while true do formatar, k = string.gsub(formatar, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k == 0 ) then break end end return formatar end -- .. código abaixo. deu certo obrigado, sabe me dizer como posso muda a formatação do texto tipo deixar com bordas nas laterais ? Edited June 28, 2020 by zRodrigoMM Link to comment
Sucrilhex Posted June 28, 2020 Share Posted June 28, 2020 4 hours ago, Angelo Pereira said: Apenas faltou : function formatNumber ( number ) local formatar = number while true do formatar, k = string.gsub(formatar, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k == 0 ) then break end end return formatar end -- .. código abaixo. uhh, verdade, esqueci de por 4 hours ago, zRodrigoMM said: deu certo obrigado, sabe me dizer como posso muda a formatação do texto tipo deixar com bordas nas laterais ? não entendi, tem algum exemplo? 1 Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 13 minutes ago, Sucrilhex said: uhh, verdade, esqueci de por não entendi, tem algum exemplo? tipo substituir por dxdrawborderedtext Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 36 minutes ago, zRodrigoMM said: tipo substituir por dxdrawborderedtext dxDrawBorderedText("#848484"..weaponClip.." #FFFFFF/ #FFFFFF"..weaponAmmo, screenW - 360 - 10, 10 + 200, screenW - 328 - 10 + 315, 20, tocolor(255, 255, 255, 255),1, Fonte, "center", "center", false, false, false, true, false) dxDrawBorderedText(Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawBorderedText(DinheiroF, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawBorderedText(DinheiroB, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) Link to comment
DNL291 Posted June 28, 2020 Share Posted June 28, 2020 https://wiki.multitheftauto.com/wiki/DxDrawBorderedText 1 Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 21 minutes ago, DNL291 said: https://wiki.multitheftauto.com/wiki/DxDrawBorderedText sim eu vi na wiki mas não sei o que to fazendo errado pra não estar renderizando Link to comment
Other Languages Moderators Lord Henry Posted June 28, 2020 Other Languages Moderators Share Posted June 28, 2020 É uma função útil. E os parâmetros dela são um pouco diferentes do dxDrawText. Vc esqueceu de declarar a espessura da borda no primeiro argumento. 1 Link to comment
zRodrigoMM Posted June 28, 2020 Author Share Posted June 28, 2020 (edited) tenho que adicionar a função outline que você deixou na wiki ? acho que fiz errado tem como me corrigir ? tipo eu olhei que eh necessário usar oNclientRender, como este código é de uma HUD não devo me preocupar por já ter este parâmetro ? desculpe é que sou leigo em questão ainda. dxDrawBorderedText(0.7,"#848484"..weaponClip.." #FFFFFF/ #FFFFFF"..weaponAmmo, screenW - 360 - 10, 10 + 200, screenW - 328 - 10 + 315, 20, tocolor(255, 255, 255, 255),1, Fonte, "center", "center", false, false, false, true, false) dxDrawBorderedText(0.7,Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawBorderedText(0.7,DinheiroF, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawBorderedText(0.7,DinheiroB, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) Edited June 28, 2020 by zRodrigoMM Link to comment
Other Languages Moderators Lord Henry Posted June 29, 2020 Other Languages Moderators Share Posted June 29, 2020 1 Link to comment
zRodrigoMM Posted June 29, 2020 Author Share Posted June 29, 2020 1 hour ago, Lord Henry said: Tenho que mudar toda a síntese desta função ? dxDrawBorderedText(0.7,"#848484"..weaponClip.." #FFFFFF/ #FFFFFF"..weaponAmmo, screenW - 360 - 10, 10 + 200, screenW - 328 - 10 + 315, 20, tocolor(255, 255, 255, 255),1, Fonte, "center", "center", false, false, false, true, false) dxDrawBorderedText(0.7,Empregos, screenW - 140 - 10, 15 + 200, screenW - 328 - 10 + 315, 30, tocolor(255, 255, 255, 255), 0.9, Fonte, "center", "center", false, false, false, false, false) dxDrawBorderedText(0.7,DinheiroF, screenW - 328 - 10, 10 + 183, screenW - 350 - 10 + 190, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) dxDrawBorderedText(0.7,DinheiroB, screenW - 328 - 10, 10 + 183, screenW - 321 - 10 + 312, 20, tocolor ( 255, 255, 255, 255 ), 0.7, Fonte, "right", "top", false, false, false, true ) Link to comment
Blaack Posted June 29, 2020 Share Posted June 29, 2020 Você já colocou está função (abaixo) no script? function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) local outline = (scale or 1) * (1.333333333333334 * (outline or 1)) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top - outline, right - outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top - outline, right + outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top + outline, right - outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top + outline, right + outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top, right - outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top, right + outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top - outline, right, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top + outline, right, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end 1 Link to comment
zRodrigoMM Posted June 29, 2020 Author Share Posted June 29, 2020 22 minutes ago, ~#BlackSCR said: Você já colocou está função (abaixo) no script? function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) local outline = (scale or 1) * (1.333333333333334 * (outline or 1)) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top - outline, right - outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top - outline, right + outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top + outline, right - outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top + outline, right + outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top, right - outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top, right + outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top - outline, right, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top + outline, right, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end deu certo obrigado, eu estava colocando acima do script, acho que por conta disso não tava renderizando. 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