Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dxDrawRoundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
- if (x and y and w and h) then
- if (not borderColor) then
- borderColor = tocolor(0, 0, 0, 200);
- end
- if (not bgColor) then
- bgColor = borderColor;
- end
- --> Background
- dxDrawRectangle(x, y, w, h, bgColor, postGUI);
- --> Border
- dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
- dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
- dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
- dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
- end
- end
- setElementData(localPlayer, "showHUD", true)
- setElementData(localPlayer, "kaja", 100)
- setElementData(localPlayer, "pia", 100)
- setElementData(localPlayer, "alvas", 100)
- function renderHud()
- if not getElementData(localPlayer, "showHUD") then
- return
- end
- local hp = getElementHealth(localPlayer)
- local kaja = getElementData(localPlayer, "kaja")
- local pia = getElementData(localPlayer, "pia")
- local alvas = getElementData(localPlayer, "alvas")
- dxDrawImage ( sx - 312 - 180, -90, 700, 370, 'hud.png') -- Háttér
- dxDrawRoundedRectangle(sx - 312 - 34, 42, hp/5*15.3, 10, tocolor(210,34,72, 150)) -- HP
- dxDrawRoundedRectangle(sx - 312 - 34, 70, alvas/5*15.3, 10, tocolor(210,34,72, 150)) -- sleep
- dxDrawRoundedRectangle(sx - 312 - 34, 98, kaja/5*15.3, 10, tocolor(210,34,72, 150)) -- Kaja
- dxDrawRoundedRectangle(sx - 312 - 34, 126, pia/5*15.3, 10, tocolor(210,34,72, 150)) -- Pia
- end
- addEventHandler("onClientRender", root, renderHud)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement