Forum

> > CS2D > Scripts > Health hudtxt
Forums overviewCS2D overview Scripts overviewLog in to reply

English Health hudtxt

10 replies
To the start Previous 1 Next To the start

old Health hudtxt

En-Kay
User Off Offline

Quote
Ok so I made a hud with health and money like mana.I can make it work for one player but I don't know how to make for each player.Can someone help me?

1
2
3
4
5
6
7
8
9
10
11
12
addhook("spawn","health")
function health ()
	parse ('hudtxt 0 "©000255000Health:" 30 420')
	parse ('hudtxt2 1 1 "©000255000'..player(1,"health")..'" 75 420 ')
	parse ('hudtxt 2 "©050050255Mana:" 30 430')
	parse ('hudtxt2 1 3 "©050050255'..player(1,"money")..'" 75 430 ')
end

addhook("ms100","_ms100")
function _ms100()
	health()
end

old Re: Health hudtxt

tek69
User Off Offline

Quote
Genius Please.

1
2
3
4
5
6
7
8
9
10
11
12
addhook("spawn","health")
function health (id)
     parse ('hudtxt 0 "©000255000Health:" 30 420')
     parse ('hudtxt2 1 1 "©000255000'..player(id,"health")..'" 75 420 ')
     parse ('hudtxt 2 "©050050255Mana:" 30 430')
     parse ('hudtxt2 1 3 "©050050255'..player(id,"money")..'" 75 430 ')
end

addhook("ms100","_ms100")
function _ms100(id)
     health()
end

old Re: Health hudtxt

Ajmin
User Off Offline

Quote
add :

1
2
3
4
5
6
7
8
addhook("ms100","mss")
function mss() 
for id = 1,32 do
parse ('hudtxt2 '..id..' 0 "©000255000Health:" 30 420')
     parse ('hudtxt2 '..id..' 1 1 "©000255000'..player(id,"health")..'" 75 420 ')
     parse ('hudtxt2 '..id..' "©050050255Mana:" 30 430')
     parse ('hudtxt2 '..id..' 1 3 "©050050255'..player(id,"money")..'" 75 430 ')
end

old Re: Health hudtxt

Admir
User Off Offline

Quote
updating hud text using ms100 hook is bad, it's make your CS2D dropping fps, use hit hook for the health (unless you using other methods) and use buy hook for money.

old Re: Health hudtxt

Dousea
User Off Offline

Quote
parse ("hudtxt 0 \"\169000255000Health:\" 30 420")
parse ("hudtxt 1 \"\169050050255Mana:\" 30 430")

addhook ("always", "alwayshook")

function alwayshook ()
	for index, id in pairs (player (0, "table")) do
		parse ("hudtxt2 " .. id .. " 2 \"\169000255000" .. player (id, "health") .. "\" 75 420")
		parse ("hudtxt2 " .. id .. " 3 \"\169050050255" .. player (id, "money") .. "\" 75 430")
	end
end

old Re: Health hudtxt

tek69
User Off Offline

Quote
@user Dousea:

Genius please again.

1
2
3
4
5
6
7
8
9
10
addhook ("always", "alwayshook")

function alwayshook ()
     for index, id in pairs (player (0, "table")) do
          parse ("hudtxt2 " .. id .. " 2 \"\169000255000" .. player (id, "health") .. "\" 75 420")
          parse ("hudtxt2 " .. id .. " 3 \"\169050050255" .. player (id, "money") .. "\" 75 430")
		  parse ("hudtxt2 " .. id .. " 4 \"\169000255000Health:\" 30 420")
			parse ("hudtxt2 " .. id .. " 5 \"\169050050255Mana:\" 30 430")
	end
end

old Re: Health hudtxt

Spartandu
BANNED Off Offline

Quote
1
2
3
4
5
6
7
function _second()
     for _, id in pairs(player(0,'table')) do
          parse('hudtxt2 '..id..' 2 "\169000255000Health: \169255255255'..player(id,'health')..'" 30 420')
          parse('hudtxt2 '..id..' 3 "\169050050255Mana: \169255255255'..player(id,'money')..'" 30 430')
     end
end
addhook ('second','_second',-5)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview