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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

Posted

position x=10, position y=10, size width =20, size height=20

Change 10, 10 to 150, 130.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

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
local x,y = guiGetScreenSize() --get their screen size 
  

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

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

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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

The "race starter pack" resource does not use the normal GTA money system, it uses element data.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

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 ?

Posted (edited)

Replace

getPlayerMoney() 

with

getElementData(localPlayer,"data.money") 

Edited by Guest

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

Posted

My bad, I meant data.money :P.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

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

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