Jump to content

GetPlayerMoney on dxtext ?


novo

Recommended Posts

Posted
addEventHandler("onClientRender",root, 
function () 
      dxDrawText(tostring(getPlayerMoney(localPlayer)),10,10,20,20,tocolor(255,255,255)) 
end) 

Posted

Thanks !

What i want to do now is a dxtext where you see Money: Yourmoney

on yourmoney, your money number.

Plz help :S

Posted
addEventHandler("onClientRender",root, 
function () 
      dxDrawText("Your money: ".. tostring(getPlayerMoney(localPlayer)),10,10,20,20,tocolor(255,255,255)) 
end) 

Posted

Thanks <3

Another question, how can i get player screen width and height ?

I want to get it, because if anybody use a different screen, they can't see like me.

Plz help <3<3

Posted

Thanks evil <3

So the full code, must be like this:

addEventHandler("onClientRender",root, 
function () 
local x,y = guiGetScreenSize() 
      dxDrawText("Your money: ".. tostring(getPlayerMoney(localPlayer)),150,130,x,y,tocolor(255,255,255)) 
end) 

Answer plz :D

Thx all <3

PD: Sorry for my bad english :/

Posted

JUST THINK A BIT, PLEASE.

use-your-mind.jpg

That script will obviously make a non-working text.

You must use a simple math to retrieve X and Y from the screen size (clue: use divition).

Posted
addEventHandler("onClientRender",root, 
function () 
local x,y = guiGetScreenSize() 
      dxDrawText("Your money: ".. tostring(getPlayerMoney(localPlayer)),150*x,130*y,150*x,150*y,tocolor(255,255,255)) 
end) 

I think this works, not sure.

Posted
addEventHandler("onClientRender",root, 
function () 
local x,y = guiGetScreenSize() 
      dxDrawText("Your money: ".. tostring(getPlayerMoney(localPlayer)),150*x,130*y,150*x,150*y,tocolor(255,255,255)) 
end) 

I think this works, not sure.

it sure does not.

as im not aware what is OP trying to do i cant help too

Posted

division is "/" you make a big s**** whit 150*x the x of scrren is 1024*150 i don't think you have 153600 pixels on your screen

you have only (1024 or littel more but 100% sure not 153600)

use x/2 y/2 this will draw the text in the midel of screen use another numbers in place of 2 to draw it where you want

Posted

Many factors could affect it. Try giving yourself any quantity of money (different from 0) from the Admin Panel. If the problem stills...

Posted

I've test it and it worked. But i want to use the money from race_starter_pack. Hmm, i've opened the "registry.db" and it looks like money are in the MoneyB table, under Money field. When i press TAB under the Money column it shows correct value. How can i make getPlayerMoney(thePlayer) has that money ?

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