Forum

> > CS2D > Scripts > Update hud info atk def
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Update hud info atk def

26 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: Update hud info atk def

oxytamine
User Off Offline

Zitieren
What do you want to do with "attack" and "defense" parameters? Place them on HUD? But what exactly? Please, tell us more.

alt Re: Update hud info atk def

Jynxxx
User Off Offline

Zitieren
And everyone this isn't that hard if you wanted for him to stop posting bullcrap threads then help him!!
1
2
3
4
5
6
function updateYOURCRAP(id)
	hudtxt2(id,21, PLAYERS[id].def, '255255000', 610,452,1)
	hudtxt2(id,23, PLAYERS[id].atk, '255255000', 610,467,1)
	hudtxt2(id,22, "Defence", '255255255', 528,452,1)
	hudtxt2(id,24, "Attack", '255255255', 528,467,1)
end

alt Re: Update hud info atk def

EngiN33R
Moderator Off Offline

Zitieren
user Jynxxx hat geschrieben
And everyone this isn't that hard if you wanted for him to stop posting bullcrap threads then help him!!


I would gladly do that if I understood what he wants.

alt Re: Update hud info atk def

Dimas541
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
function updateYOURCRAP(id)
     hudtxt2(id,21, PLAYERS[id].def, '255255000', 610,452,1)
     hudtxt2(id,23, PLAYERS[id].atk, '255255000', 610,467,1)
     hudtxt2(id,22, "Defence", '255255255', 528,452,1)
     hudtxt2(id,24, "Attack", '255255255', 528,467,1)
end

Not Working

alt Re: Update hud info atk def

Jynxxx
User Off Offline

Zitieren
@user Dimas541: Sorry I posted that awhile back and didn't know what I was doing
1
2
3
4
5
6
function updateYOURCRAP(id)
     hudtxt2(id,21, PLAYERS[id].tmp.def, '255255000', 610,452,1)
     hudtxt2(id,23, PLAYERS[id].tmp.atk, '255255000', 610,467,1)
     hudtxt2(id,22, "Defence", '255255255', 528,452,1)
     hudtxt2(id,24, "Attack", '255255255', 528,467,1)
end

alt Re: Update hud info atk def

Jynxxx
User Off Offline

Zitieren
Just find this in your functions.lua and replace it with this.
1
2
3
4
5
6
7
8
9
10
function updateHUD(id)
	for i, v in ipairs(CONFIG.STATS) do
		hudtxt2(id, #CONFIG.STATS+i, v, '255255255', 510, 407+(i-1)*CONFIG.PIXELS, 0)
		hudtxt2(id, i, PLAYERS[id][v], '255255000', 620, 407+(i-1)*CONFIG.PIXELS, 2)
		hudtxt2(id,21, PLAYERS[id].tmp.def, '255255000', 610,452,1)
		hudtxt2(id,23, PLAYERS[id].tmp.atk, '255255000', 610,467,1)
		hudtxt2(id,22, "Defence", '255255255', 528,452,1)
		hudtxt2(id,24, "Attack", '255255255', 528,467,1)
	end
end

alt Re: Update hud info atk def

Runnin
User Off Offline

Zitieren
user Jynxxx hat geschrieben
Just find this in your functions.lua and replace it with this.
1
2
3
4
5
6
7
8
9
10
function updateHUD(id)
	for i, v in ipairs(CONFIG.STATS) do
		hudtxt2(id, #CONFIG.STATS+i, v, '255255255', 510, 407+(i-1)*CONFIG.PIXELS, 0)
		hudtxt2(id, i, PLAYERS[id][v], '255255000', 620, 407+(i-1)*CONFIG.PIXELS, 2)
		hudtxt2(id,21, PLAYERS[id].tmp.def, '255255000', 610,452,1)
		hudtxt2(id,23, PLAYERS[id].tmp.atk, '255255000', 610,467,1)
		hudtxt2(id,22, "Defence", '255255255', 528,452,1)
		hudtxt2(id,24, "Attack", '255255255', 528,467,1)
	end
end


When i use ur code, the atk and def only updates when picking up money or dropping it. And when gaining exp too i think. Fix it please

alt Re: Update hud info atk def

EndDead
User Off Offline

Zitieren
user Runnin hat geschrieben
When i use ur code, the atk and def only updates when picking up money or dropping it. And when gaining exp too i think. Fix it please

Add 'UpdateHUD(id)' after the equip function, Everything will be fine (Before the 'end' block for sure)

alt Re: Update hud info atk def

4Vendetta
User Off Offline

Zitieren
user Runnin hat geschrieben
user Jynxxx hat geschrieben
Just find this in your functions.lua and replace it with this.
1
2
3
4
5
6
7
8
9
10
function updateHUD(id)
	for i, v in ipairs(CONFIG.STATS) do
		hudtxt2(id, #CONFIG.STATS+i, v, '255255255', 510, 407+(i-1)*CONFIG.PIXELS, 0)
		hudtxt2(id, i, PLAYERS[id][v], '255255000', 620, 407+(i-1)*CONFIG.PIXELS, 2)
		hudtxt2(id,21, PLAYERS[id].tmp.def, '255255000', 610,452,1)
		hudtxt2(id,23, PLAYERS[id].tmp.atk, '255255000', 610,467,1)
		hudtxt2(id,22, "Defence", '255255255', 528,452,1)
		hudtxt2(id,24, "Attack", '255255255', 528,467,1)
	end
end


When i use ur code, the atk and def only updates when picking up money or dropping it. And when gaining exp too i think. Fix it please


I tested and this works o.o

alt Re: Update hud info atk def

Me Gusta
User Off Offline

Zitieren
send screen shots for me see
thanks all users when help me

those who swore at me calling
me trash talking to banish me
vain if not fuck idiots need your
help _l_

alt Re: Update hud info atk def

Dimas541
User Off Offline

Zitieren
Where I am right this Paste
1
2
3
4
5
6
7
8
9
10
function updateHUD(id)
     for i, v in ipairs(CONFIG.STATS) do
          hudtxt2(id, #CONFIG.STATS+i, v, '255255255', 510, 407+(i-1)*CONFIG.PIXELS, 0)
          hudtxt2(id, i, PLAYERS[id][v], '255255000', 620, 407+(i-1)*CONFIG.PIXELS, 2)
          hudtxt2(id,21, PLAYERS[id].tmp.def, '255255000', 610,452,1)
          hudtxt2(id,23, PLAYERS[id].tmp.atk, '255255000', 610,467,1)
          hudtxt2(id,22, "Defence", '255255255', 528,452,1)
          hudtxt2(id,24, "Attack", '255255255', 528,467,1)
     end
end
Spoiler >

alt Re: Update hud info atk def

4Vendetta
User Off Offline

Zitieren
Nice, but with this, whem you leave the server your stats (atk, def and spd) will not save, because is separated by CONFIG.STATS, Only Exp, Level, money and equips will save, atk, def, and spd not!

alt Re: Update hud info atk def

Yates
Reviewer Off Offline

Zitieren
@user 4Vendetta: This would not matter anyway, as your attack, defence and speed are calculated when you die, pickup/equip a weapon, drop an item etc.
1× editiert, zuletzt 25.10.12 14:55:14

alt Re: Update hud info atk def

Jynxxx
User Off Offline

Zitieren
You could always just do this...
1
2
3
4
5
6
addhook("ms100","_ms100")
function _ms100()
	for _, id in ipairs(player(0, "tableliving")) do
		updateHUD(id)
	end
end
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht