Jump to content

dxDrawText Money


Laysiks

Recommended Posts

Explain better.

I think he want's to draw the money with PLN in front (I think it's Poland's Currency)

Simple Script: (Client-Side)

addEventHandler("onClientRender", function() 
    dxDrawText("PLN "..getPlayerMoney(getLocalPlayer()), 200, 200) 
end) 
addEventHandler("onResourceStart", function() 
    setPlayerHudComponentVisible(getLocalPlayer(), "money", false) 
end) 

Functions Used:

dxDrawText: https://wiki.multitheftauto.com/wiki/DxDrawText

getPlayerMoney: https://wiki.multitheftauto.com/wiki/GetPlayerMoney

setPlayerHudComponentVisible: https://wiki.multitheftauto.com/wiki/Se ... entVisible

I haven't tested it, but it should work.

Link to comment
You can easily calculate the relative resolution between yours (which the text should be perfect on) and the client's. Of course there are other ways.
--simple code: 
local screenX, screenY = guiGetScreenSize() -- getting my screen size 
local myScreenX, myScreenY  = 1024, 768  -- the resolution you use. in my case is 1024x768 
X, Y = (screenX/myScreenX), (screenX/myScreenY) -- calculating the size of my screen with my resolution. 

syntax:

dxDrawText("PLN "..getPlayerMoney(getLocalPlayer()), X*814, Y*40, 100, 100, tocolor(255, 255, 255, 255), 1.50, "pricedown", "center", "center", false, false, false, false, false) 

Link to comment

On my resolution 1024x768 :

dxDrawText(string.format("£ %08d",getPlayerMoney(localPlayer)), X*1675, Y*150, 100, 100, tocolor(0, 75, 0, 255), 1.50, "pricedown", "center", "center", false, false, false, false, false) 

But in higher resolutions this text is on health bar. Can some one help me ?

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