السلام عليكم
كيف اخلي الدم يكون دم السياره مب دم اللعب
local screenW, screenH = guiGetScreenSize()
function test()
local hp = getElementHealth(localPlayer)
setPlayerHudComponentVisible("health",false)
dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412/100*hp, screenH * 0.0404, tocolor(254, 0, 0, 255), false)
dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true)
dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true)
dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true)
dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true)
dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412, screenH * 0.0404, tocolor(254, 0, 0, 72), true)
dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) - 1, (screenW * 0.9926) - 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) - 1, (screenW * 0.9926) + 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) + 1, (screenW * 0.9926) - 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) + 1, (screenW * 0.9926) + 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText(""..math.floor(hp).."%", screenW * 0.8507, screenH * 0.5378, screenW * 0.9926, screenH * 0.5781, tocolor(255, 255, 255, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false)
end
addEventHandler('onClientRender',root,test)
function trueHud()
setPlayerHudComponentVisible("health",true)
end
addEventHandler('onResourceStop',root,trueHud)