Laysiks Posted March 8, 2015 Posted March 8, 2015 Hello who can give me code with drawing money like this. PLN 00000000 ? To all resolutions. Ty you.
steadyfi Posted March 8, 2015 Posted March 8, 2015 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.
JR10 Posted March 8, 2015 Posted March 8, 2015 dxDrawText 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.
steadyfi Posted March 8, 2015 Posted March 8, 2015 I need it scaled for all resolutions. What do you mean ? I think dxDrawText works with all of them
JR10 Posted March 8, 2015 Posted March 8, 2015 A simple search on the forums and you will find a plethora of topics related to what you need. viewtopic.php?f=91&t=82677&p=753736&hilit=dx+text+resolution#p753736
Enargy, Posted March 8, 2015 Posted March 8, 2015 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)
Enargy, Posted March 8, 2015 Posted March 8, 2015 multiply the value x, y the dxDrawTextand multiply it by the two variants X, Y. which calculates the resolution.
DNL291 Posted March 8, 2015 Posted March 8, 2015 drawing money like this. PLN 00000000 ? For this format use: string.format( "%08d", getPlayerMoney(localPlayer) )
Laysiks Posted March 8, 2015 Author Posted March 8, 2015 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 ?
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