Jump to content

[HELP] Circle Health Bar


@RUSH

Recommended Posts

14 minutes ago, NeXuS™ said:

Just download the example given there, and understand the code there.

this will not help you. he does not know anything about it. and neither for me. please create an example for the staff to be able to understand. This will help a lot of people here. Thanks

Link to comment
local sWidth, sHeight = guiGetScreenSize()
local hud = {}

hud.bgHpX = sWidth - 200
hud.bgHpY = 20
hud.bgHpW = 50 -- pixels img
hud.bgHpH = 50 -- pixels img

hud.HpX = sWidth - 195.5
hud.HpY = 65
hud.HpW = 42 -- pixels img
hud.HpH = 42 -- pixels img

function onClientRender()
	dxDrawImage(hud.bgHpX, hud.bgHpY, hud.bgHpW, hud.bgHpH, "design/hp_bg.png") -- background hp

	local hp = getElementHealth(getLocalPlayer())
	local hpHeigth = hud.HpH / 100 * (hp)
	dxDrawImageSection(hud.HpX, hud.HpY, hud.HpW, -hpHeigth, 0, 0, hud.HpW, -hpHeigth, "design/hp_full.png", 0, 0, 0, 0x50FF0000, false)
end
addEventHandler("onClientRender", root, onClientRender)

Here is an example.

 

Link to comment
2 hours ago, MainSCR said:

local sWidth, sHeight = guiGetScreenSize()
local hud = {}

hud.bgHpX = sWidth - 200
hud.bgHpY = 20
hud.bgHpW = 50 -- pixels img
hud.bgHpH = 50 -- pixels img

hud.HpX = sWidth - 195.5
hud.HpY = 65
hud.HpW = 42 -- pixels img
hud.HpH = 42 -- pixels img

function onClientRender()
	dxDrawImage(hud.bgHpX, hud.bgHpY, hud.bgHpW, hud.bgHpH, "design/hp_bg.png") -- background hp

	local hp = getElementHealth(getLocalPlayer())
	local hpHeigth = hud.HpH / 100 * (hp)
	dxDrawImageSection(hud.HpX, hud.HpY, hud.HpW, -hpHeigth, 0, 0, hud.HpW, -hpHeigth, "design/hp_full.png", 0, 0, 0, 0x50FF0000, false)
end
addEventHandler("onClientRender", root, onClientRender)

Here is an example.

 

Not is imageselection my friend.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...