hi guys, i know u all chat in russian, but i always use translator to search information in this forum because i don't understand russian. all i wanted to ask is how to make this hpbar to have armor and hp numbers in one drawbar? https://blast.hk/threads/15519/ thank you :)
while true do
wait(0)
if not isPauseMenuActive() and isPlayerPlaying(playerHandle) then
if active == 1 then
local HP = getCharHealth(playerPed)
local playerposX, playerposY, playerposZ = getCharCoordinates(playerPed)
local screenX, screenY = convert3DCoordsToScreen(playerposX, playerposY, playerposZ)
drawBar(screenX - 50, screenY, 100, 20, 0xBFDF0101, 0xBF610B0B, 2, font, HP)
end
end
end
end
function drawBar(posX, posY, sizeX, sizeY, color1, color2, borderThickness, font, value)
renderDrawBoxWithBorder(posX, posY, sizeX, sizeY, color2, borderThickness, 0xFF000000)
renderDrawBox(posX + borderThickness, posY + borderThickness, sizeX / 100 * value - (borderThickness * 2), sizeY - (2 * borderThickness), color1)
local textLenght = renderGetFontDrawTextLength(font, tostring(value))
local textHeight = renderGetFontDrawHeight(font)
renderFontDrawText(font, tostring(value), posX + (sizeX / 2) - (textLenght / 2), posY + (sizeY / 2) - (textHeight / 2), 0xFFFFFFFF)
end
wait(0)
if not isPauseMenuActive() and isPlayerPlaying(playerHandle) then
if active == 1 then
local HP = getCharHealth(playerPed)
local playerposX, playerposY, playerposZ = getCharCoordinates(playerPed)
local screenX, screenY = convert3DCoordsToScreen(playerposX, playerposY, playerposZ)
drawBar(screenX - 50, screenY, 100, 20, 0xBFDF0101, 0xBF610B0B, 2, font, HP)
end
end
end
end
function drawBar(posX, posY, sizeX, sizeY, color1, color2, borderThickness, font, value)
renderDrawBoxWithBorder(posX, posY, sizeX, sizeY, color2, borderThickness, 0xFF000000)
renderDrawBox(posX + borderThickness, posY + borderThickness, sizeX / 100 * value - (borderThickness * 2), sizeY - (2 * borderThickness), color1)
local textLenght = renderGetFontDrawTextLength(font, tostring(value))
local textHeight = renderGetFontDrawHeight(font)
renderFontDrawText(font, tostring(value), posX + (sizeX / 2) - (textLenght / 2), posY + (sizeY / 2) - (textHeight / 2), 0xFFFFFFFF)
end
Последнее редактирование: