Jump to content

[HELP] Money Back[SOLVED]


#RooTs

Recommended Posts

what is the function of increasing money back?

I do not intendi very well, because it has some scripts that have "local"

local moneycount=getPlayerMoney(getLocalPlayer())

this work add "local" ?

Show me an example, please

is this the same?

moneycount=getPlayerMoney(getLocalPlayer()) 
money= '$ ' ..moneycount -- Money 
  
dxDrawText(tostring (money),sWidth-200,sHeight-35,sWidth-5,sHeight-35,tocolor(0,0,0,255),1.7,digFont,"right","top",false,false,false) 

Example

|$0 >>>>>

<<<<< $0|

Example end

13963.png

Edited by Guest
Link to comment

No that would not work. If this is the entire script, then you would have to fix a number of things:

1. sWidth and sHeight are not defined.

2. digFont is not a font, I'm guessing you're going to be using a custom font.

3. There is no onClientRender handler.

4. In the picture the money is shown in white. The rgb values you put in your script would make the text black.

Good luck :D

Link to comment

Client.lua

local newFont = dxCreateFont( "font/font.ttf", 15 ) 
local newFont2 = dxCreateFont( "font/font.ttf", 9 ) 
local newFont3 = dxCreateFont( "font/font.ttf", 24 ) 
  
local LOCAL_PLAYER = getLocalPlayer() 
pos = getElementPosition(LOCAL_PLAYER) 
showPlayerHudComponent("radar",true) 
showPlayerHudComponent ("weapon", false ) 
showPlayerHudComponent ( "ammo", false ) 
showPlayerHudComponent ("vehicle_name", false ) 
  
  
function dxtest() 
local playerX, playerY, playerZ = getElementPosition( LOCAL_PLAYER )  -- Get player's coordinates. 
           
    local playerZoneName =  getZoneName( playerX, playerY, playerZ )  
    local health = string.format("%03d", (getElementHealth(LOCAL_PLAYER))) 
    local armor = math.floor (getPedArmor(LOCAL_PLAYER)) 
    local stat = getPedStat(LOCAL_PLAYER,24) 
    local time = getRealTime() 
    local hr,mins = getTime() 
    local time3 = hr..":"..(((mins <10) and "0"..mins) or mins) 
    local hours = time.hour 
    local minutes = time.minute 
    local sWidth,sHeight = guiGetScreenSize() 
  
    dxDrawImage((740/1024)*sWidth, (8/768)*sHeight, (283/1024)*sWidth, (120/768)*sHeight, "outras/background.png",0,0,0,tocolor(0,0,0,255)) 
    dxDrawImage((868/1024)*sWidth, (60/768)*sHeight, (148/1024)*sWidth, (38/768)*sHeight, "outras/background.png",0,0,0,tocolor(255,255,255,255)) 
    dxDrawImage((873/1024)*sWidth, (63/768)*sHeight, (22/1024)*sWidth, (33/768)*sHeight, "outras/$.png",0,0,0,tocolor(255,255,255,255)) 
    dxDrawImage((765/1024)*sWidth, (25/768)*sHeight, (85/1024)*sWidth, (85/768)*sHeight, "img/"..getPedWeapon(getLocalPlayer())..".png") 
  
  
    --money back 
    local moneycount = getPlayerMoney(getLocalPlayer()) 
    local money = ' ' ..moneycount -- Money 
    dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false)  
  
    dxDrawText(tostring (armor).." %",(875/1024)*sWidth, (24/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) 
    dxDrawImage((845.7/1024)*sWidth, (24/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png") 
  
  
    dxDrawText(tostring (health).." %",(950/1024)*sWidth, (19/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) 
    dxDrawImage((920.7/1024)*sWidth, (19/768)*sHeight, (30/1024)*sWidth, (30/768)*sHeight, "outras/HP.png") 
  
  
end 
addEventHandler("onClientRender",getRootElement(), dxtest) 
  
  
root = getResourceRootElement() 
function changeit() 
showPlayerHudComponent("money",false) 
showPlayerHudComponent("area_name",false) 
showPlayerHudComponent("health",false) 
showPlayerHudComponent("clock",false) 
showPlayerHudComponent("armour",false) 
showPlayerHudComponent("oxygen",false) 
end 
addEventHandler("onClientResourceStart",root, changeit) 
  
  
addEvent("onEnter",true) 
addEventHandler("onEnter",getRootElement(),carHealth) 
addEventHandler("onClientRender",getRootElement(),carHealth) 

Link to comment
Client.lua
local newFont = dxCreateFont( "font/font.ttf", 15 ) 
local newFont2 = dxCreateFont( "font/font.ttf", 9 ) 
local newFont3 = dxCreateFont( "font/font.ttf", 24 ) 
  
local LOCAL_PLAYER = getLocalPlayer() 
pos = getElementPosition(LOCAL_PLAYER) 
showPlayerHudComponent("radar",true) 
showPlayerHudComponent ("weapon", false ) 
showPlayerHudComponent ( "ammo", false ) 
showPlayerHudComponent ("vehicle_name", false ) 
  
  
function dxtest() 
local playerX, playerY, playerZ = getElementPosition( LOCAL_PLAYER )  -- Get player's coordinates. 
           
    local playerZoneName =  getZoneName( playerX, playerY, playerZ )  
    local health = string.format("%03d", (getElementHealth(LOCAL_PLAYER))) 
    local armor = math.floor (getPedArmor(LOCAL_PLAYER)) 
    local stat = getPedStat(LOCAL_PLAYER,24) 
    local time = getRealTime() 
    local hr,mins = getTime() 
    local time3 = hr..":"..(((mins <10) and "0"..mins) or mins) 
    local hours = time.hour 
    local minutes = time.minute 
    local sWidth,sHeight = guiGetScreenSize() 
  
    dxDrawImage((740/1024)*sWidth, (8/768)*sHeight, (283/1024)*sWidth, (120/768)*sHeight, "outras/background.png",0,0,0,tocolor(0,0,0,255)) 
    dxDrawImage((868/1024)*sWidth, (60/768)*sHeight, (148/1024)*sWidth, (38/768)*sHeight, "outras/background.png",0,0,0,tocolor(255,255,255,255)) 
    dxDrawImage((873/1024)*sWidth, (63/768)*sHeight, (22/1024)*sWidth, (33/768)*sHeight, "outras/$.png",0,0,0,tocolor(255,255,255,255)) 
    dxDrawImage((765/1024)*sWidth, (25/768)*sHeight, (85/1024)*sWidth, (85/768)*sHeight, "img/"..getPedWeapon(getLocalPlayer())..".png") 
  
  
    --money back 
    local moneycount = getPlayerMoney(getLocalPlayer()) 
    local money = ' ' ..moneycount -- Money 
    dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false)  
  
    dxDrawText(tostring (armor).." %",(875/1024)*sWidth, (24/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) 
    dxDrawImage((845.7/1024)*sWidth, (24/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png") 
  
  
    dxDrawText(tostring (health).." %",(950/1024)*sWidth, (19/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) 
    dxDrawImage((920.7/1024)*sWidth, (19/768)*sHeight, (30/1024)*sWidth, (30/768)*sHeight, "outras/HP.png") 
  
  
end 
addEventHandler("onClientRender",getRootElement(), dxtest) 
  
  
root = getResourceRootElement() 
function changeit() 
showPlayerHudComponent("money",false) 
showPlayerHudComponent("area_name",false) 
showPlayerHudComponent("health",false) 
showPlayerHudComponent("clock",false) 
showPlayerHudComponent("armour",false) 
showPlayerHudComponent("oxygen",false) 
end 
addEventHandler("onClientResourceStart",root, changeit) 
  
  
addEvent("onEnter",true) 
addEventHandler("onEnter",getRootElement(),carHealth) 
addEventHandler("onClientRender",getRootElement(),carHealth) 

what u want?

Link to comment
Client.lua
[...] 
    --money back 
    local moneycount = getPlayerMoney(getLocalPlayer()) 
    local money = ' ' ..moneycount -- Money 
    dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false)  
 [...] 

change this:

newFont,"left","top"

to:

newFont,"right","top"

Link to comment

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