Jump to content

pontuação decimal no dinheiro


Recommended Posts

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
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 )

 

  • Like 1
  • Thanks 2
Link to comment
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
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 by zRodrigoMM
Link to comment
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?

  • Thanks 1
Link to comment
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
  • Other Languages Moderators

É 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.

  • Thanks 1
Link to comment

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 by zRodrigoMM
Link to comment
1 hour ago, Lord Henry said:

image.png.77c234c433fc232ff509e7753b1be49d.png

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

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

 

  • Thanks 1
Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...