novo Posted December 6, 2011 Posted December 6, 2011 Hi all. I want know how to export: getPlayerMoney(thePlayer) on a dxtext syntax. Plz help me
Castillo Posted December 6, 2011 Posted December 6, 2011 addEventHandler("onClientRender",root, function () dxDrawText(tostring(getPlayerMoney(localPlayer)),10,10,20,20,tocolor(255,255,255)) end)
novo Posted December 6, 2011 Author Posted December 6, 2011 Thanks ! What i want to do now is a dxtext where you see Money: Yourmoney on yourmoney, your money number. Plz help
Castillo Posted December 6, 2011 Posted December 6, 2011 addEventHandler("onClientRender",root, function () dxDrawText("Your money: ".. tostring(getPlayerMoney(localPlayer)),10,10,20,20,tocolor(255,255,255)) end)
novo Posted December 6, 2011 Author Posted December 6, 2011 Thanks <3 I have a question, How can i set to position 150, 130 ? Plz help <3
Castillo Posted December 6, 2011 Posted December 6, 2011 position x=10, position y=10, size width =20, size height=20 Change 10, 10 to 150, 130.
novo Posted December 7, 2011 Author Posted December 7, 2011 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
Evil-Cod3r Posted December 7, 2011 Posted December 7, 2011 local x,y = guiGetScreenSize() --get their screen size
novo Posted December 7, 2011 Author Posted December 7, 2011 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 Thx all <3 PD: Sorry for my bad english
12p Posted December 7, 2011 Posted December 7, 2011 JUST THINK A BIT, PLEASE. 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).
Xeno Posted December 7, 2011 Posted December 7, 2011 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.
karlis Posted December 8, 2011 Posted December 8, 2011 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
bandi94 Posted December 8, 2011 Posted December 8, 2011 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
h4x7o0r Posted December 10, 2011 Posted December 10, 2011 Does anyone know why it shows me 0 money ? I'm using Race Starter Pack and money is generated from roll/spin/wins.
12p Posted December 10, 2011 Posted December 10, 2011 Many factors could affect it. Try giving yourself any quantity of money (different from 0) from the Admin Panel. If the problem stills...
Castillo Posted December 10, 2011 Posted December 10, 2011 The "race starter pack" resource does not use the normal GTA money system, it uses element data.
h4x7o0r Posted December 10, 2011 Posted December 10, 2011 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 ?
Castillo Posted December 10, 2011 Posted December 10, 2011 (edited) Replace getPlayerMoney() with getElementData(localPlayer,"data.money") Edited December 10, 2011 by Guest
h4x7o0r Posted December 10, 2011 Posted December 10, 2011 Same with "money" (actually i've tried before post ) LE: Now it works well. Thank you Solidsnake14 . getElementData(localPlayer,"Money")
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