Forum

> > CS2D > Scripts > [SOLVED] Reset tables on leave/join
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [SOLVED] Reset tables on leave/join

1 Antwort
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [SOLVED] Reset tables on leave/join

SkullFace
User Off Offline

Zitieren
I've been trying to make player ID specific tables to restart on leave or join. I've failed and don't know what to do next. Any hints or tips? Or maybe other ways to do it?
Code :
Spoiler >

Image :


EDIT :Ugh, figured out... it was
PlayerHP[id]
instead of
PlayerHP[i]

Sorry about this. You can delete the post now.
2× editiert, zuletzt 18.07.18 09:33:31

alt Re: [SOLVED] Reset tables on leave/join

Rainoth
Moderator Off Offline

Zitieren
You can change the title to [SOLVED] if you solve the problem.
With that said, I'd advise using a single table for these things.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
stats = {
player = {},
max = {spd = 40, hp = 250},
hooks = {"second","join"}
}
for k,v in pairs(stats.hooks) do
	addhook(v, "_"..v)
end

function _join(id)
	stats.player[id] = {hp = 100, armor = 0, spd = 0}
end

function _second()
	for _,id in pairs (player(0,"team2")) do
		parse('hudtxt2 '..id..' 0 "Player HP: '..stats.player[id].hp..'" 40 40')
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht