Forum

> > CS2D > Scripts > Health hudtxt
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Health hudtxt

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Health hudtxt

En-Kay
User Off Offline

Zitieren
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

alt Re: Health hudtxt

tek69
User Off Offline

Zitieren
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

alt Re: Health hudtxt

Ajmin
User Off Offline

Zitieren
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

alt Re: Health hudtxt

Admir
User Off Offline

Zitieren
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.

alt Re: Health hudtxt

Dousea
User Off Offline

Zitieren
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

alt Re: Health hudtxt

tek69
User Off Offline

Zitieren
@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

alt Re: Health hudtxt

Spartandu
BANNED Off Offline

Zitieren
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)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht