Jump to content

Help


Recommended Posts

Posted

Hello all i make a hud for the money with dx, but the system was doesnt shows the player money, just if i am restart the resource . Please help me my resource is

local x,y = guiGetScreenSize() 
local money = getPlayerMoney ( localPlayer )  
local myFont = nil 
  
function drawStuff() 
    dxDrawRectangle ( x/1.2, y/5, x/7, y/25, tocolor ( 0, 0, 0, 150 ) ) 
    dxDrawText ( "Game Points:" ..money, x/1.2, y/5, x, y, tocolor (255, 255, 255, 255), 1, "bankgothic" ) 
  
end 
addEventHandler("onClientRender", root, drawStuff) 
  
  

Posted

What exactly is the problem here? The text is not there? Money doesn't update? Please explain better.

If there are any errors please post them.

Posted
local x, y = guiGetScreenSize() 
local myFont = nil -- You need this? 
  
addEventHandler("onClientRender", root, 
function() 
    dxDrawRectangle(x/1.2, y/5, x/7, y/25, tocolor(0, 0, 0, 150)) 
    dxDrawText("Game Points:"..getPlayerMoney(), x/1.2, y/5, x, y, tocolor(255, 255, 255, 255), 1, "bankgothic") 
end) 

Posted
the problem is you don't need to use localPlayer with getPlayerMoney.

This shouldn't be a problem, if the function doesn't accept any parameters, providing it with ones won't matter.

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