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)