Jump to content

Money


Matevsz

Recommended Posts

Posted

I do not mean to give a player money just by changing the appearance, for example. shaders or any dxDraw but unfortunately can not do that and please help

Posted
No @blinker

You should use convertNumber function. Find it on the wiki page

You're still going wrong. convertNumber is related to other stuff.

You should yeah use a dxDraw, what is that it stops you from not doing so?

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

Yes it is @Hypex!

He wanna format the number with dots in million and thousan numbers. That function should do.that! Then he has to draw with dx but to formAt is convertNumber

350x20_FFFFFF_FFFFFF_000000_000000.png

http://i.imgur.com/CSE28MJ.png

Don't hesitate to contact me for anything! If I can help, I will for sure!

Education is the most powerful weapon which you can use to change the world. - Castillo

  • Moderators
Posted

@Matevsz

If you don't understand shaders, make it with dx as the other guys say.

Now please post your code. (after your wrote it...)

[url=https://wiki.multitheftauto.com/wiki/DxDrawText]https://wiki.multitheftauto.com/wiki/DxDrawText[/url] 
[url=https://wiki.multitheftauto.com/wiki/OnClientRender]https://wiki.multitheftauto.com/wiki/OnClientRender[/url] 
[url=https://wiki.multitheftauto.com/wiki/DxSetAspectRatioAdjustmentEnabled]https://wiki.multitheftauto.com/wiki/Dx ... entEnabled[/url] 
[url=https://wiki.multitheftauto.com/wiki/ShowPlayerHudComponent]https://wiki.multitheftauto.com/wiki/Sh ... dComponent[/url] 
[url=https://wiki.multitheftauto.com/wiki/GetPlayerMoney]https://wiki.multitheftauto.com/wiki/GetPlayerMoney[/url] 
[url=https://wiki.multitheftauto.com/wiki/GuiGetScreenSize]https://wiki.multitheftauto.com/wiki/GuiGetScreenSize[/url] 

I gave you everything you need, try the code yourself.

Don't start crying that you can't try it, because you will end up in my foes group and you won't get help from me any more. :evil:

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

try this

function convertNumber ( number )   
    local formatted = number   
    while true do       
        formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')     
        if ( k==0 ) then       
            break   
        end   
    end   
    return formatted 
end 
  
local money = getPlayerMoney(getLocalPlayer()) 
dxDrawText("R$: "..convertNumber(money), x*0.827, y*0.150, x*800, y*030, tocolor(255, 255, 255,255), 0.7, "bankgothic", "left", "top", false, false, true, false, false) 
  

Look hud :wink::wink:

F3aW0fa.png

 DUyJ810.gif

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