oi, sou novo na area de programaçao em .lua e fazer paineis dx.
bom resolvi fazer uma hud, o mta reconhece o script mas a hud na aparece quando executo o mesmo.
codigo:
local screenW, screenH = guiGetScreenSize()
function hud ()
local vida = getElementHealth ( localPlayer )
local colete = getPedArmor ( localPlayer )
local muniçao = getPedAmmoInClip ( localPlayer )
local total = getPedTotalAmmo ( localPlayer )
local Oxigenio = getPedOxygenLevel ( localPlayer )
local dinheiro = getPlayerMoney ( localPlayer )
local arma = gerPedWeapon ( localPlayer )
local vidaatual = (screenW * 0.0889) * (vida/100)
local coleteatual = (screenW * 0.0889) * (colete/100)
dxDrawRectangle(screenW * 0.7148, screenH * 0.0000, screenW * 0.2852, screenH * 0.0859, tocolor(0, 0, 0, 193), false)
dxDrawImage(screenW * 0.7246, screenH * 0.0195, screenW * 0.0381, screenH * 0.0430, ":Hud/img/22.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(screenW * 0.7686, screenH * 0.0273, screenW * 0.0889, screenH * 0.0273, tocolor(173, 0, 0, 126), false)
dxDrawRectangle(screenW * 0.7686, screenH * 0.0273, vidaatual, screenH * 0.0273, tocolor(173, 0, 0, 254), false)
dxDrawImage(screenW * 0.8633, screenH * 0.0143, screenW * 0.0342, screenH * 0.0456, ":Hud/img/27.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(screenW * 0.9014, screenH * 0.0273, screenW * 0.0889, screenH * 0.0273, tocolor(116, 116, 116, 141), false)
dxDrawRectangle(screenW * 0.9014, screenH * 0.0273, coleteatual, screenH * 0.0273, tocolor(116, 116, 116, 254), false)
dxDrawImage(screenW * 0.7207, screenH * 0.0859, screenW * 0.0576, screenH * 0.0716, ":Hud/armas/"..arma..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("1|0", (screenW * 0.7246) - 1, (screenH * 0.1589) - 1, (screenW * 0.7725) - 1, (screenH * 0.1797) - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("1|0", (screenW * 0.7246) + 1, (screenH * 0.1589) - 1, (screenW * 0.7725) + 1, (screenH * 0.1797) - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("1|0", (screenW * 0.7246) - 1, (screenH * 0.1589) + 1, (screenW * 0.7725) - 1, (screenH * 0.1797) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("1|0", (screenW * 0.7246) + 1, (screenH * 0.1589) + 1, (screenW * 0.7725) + 1, (screenH * 0.1797) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("1|0", screenW * 0.7246, screenH * 0.1589, screenW * 0.7725, screenH * 0.1797, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawRectangle(screenW * 0.7832, screenH * 0.0924, screenW * 0.2070, screenH * 0.0534, tocolor(1, 1, 1, 197), false)
dxDrawImage(807, 76, 30, 26, ":Hud/img/10.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(screenW * 0.8271, screenH * 0.1120, screenW * 0.0605, screenH * 0.0143, tocolor(129, 130, 0, 197), false)
dxDrawRectangle(screenW * 0.8271, screenH * 0.1120, screenW * 0.0605, screenH * 0.0143, tocolor(233, 235, 0, 254), false)
dxDrawImage(914, 79, 27, 23, ":Hud/img/17.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(screenW * 0.9248, screenH * 0.1120, screenW * 0.0605, screenH * 0.0143, tocolor(2, 180, 232, 162), false)
dxDrawRectangle(screenW * 0.9248, screenH * 0.1120, screenW * 0.0605, screenH * 0.0143, tocolor(1, 174, 225, 254), false)
dxDrawRectangle(screenW * 0.7822, screenH * 0.1549, screenW * 0.0918, screenH * 0.0378, tocolor(0, 0, 0, 194), false)
dxDrawText("Oxigenio:"..Oxigenio.."%", screenW * 0.7813, screenH * 0.1576, screenW * 0.8740, screenH * 0.1927, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
dxDrawText("R$"..dinheiro.., screenW * 0.7813, screenH * 0.2018, screenW * 0.9688, screenH * 0.2227, tocolor(53, 251, 0, 194), 2.00, "default-bold", "left", "top", false, false, false, false, false)
end
)
addEventHandler( "onClientRender", getRootElement(), hud )