Forum

> > CS2D > Scripts > Score, deaths
Forums overviewCS2D overview Scripts overviewLog in to reply

English Score, deaths

13 replies
To the start Previous 1 Next To the start

old Score, deaths

HedShot
User Off Offline

Quote
Hi all!

I need a script that will list the top left corner of your score and death. Please write codes!

Thanks for all! (sorry for my english)

old Re: Score, deaths

Dynamite07
User Off Offline

Quote
1
2
3
4
5
6
7
addhook("always","a1")
function a1()
for a = 1,32 do
parse('hudtxt2 '..a..' 0 "©000255000Kills:'..player(a,"score")..'" 10 20')
parse('hudtxt2 '..a..' 1 "©000255000Deaths:'..player(a,"deaths")..'" 10 40')
end
end

old Re: Score, deaths

Yates
Reviewer Off Offline

Quote
That's the worst code ever.

@user Dynamite07: Use kill and death hook. Using always hook is like the most stupid thing you can do.

old Re: Score, deaths

Dynamite07
User Off Offline

Quote
I thought the same,
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("kill","a1")
function a1()
for a = 1,32 do
parse('hudtxt2 '..a..' 0 "©000255000Kills:'..player(a,"score")..'" 10 20')
end
end

addhook("die","a1")
function a1()
for a = 1,32 do
parse('hudtxt2 '..a..' 0 parse('hudtxt2 '..a..' 1 "©000255000Deaths:'..player(a,"deaths")..'" 10 40')
end
end

user HedShot has written
Sorry I'm new to lua.
its me.

old Re: Score, deaths

Yates
Reviewer Off Offline

Quote
What are you doing!?

Both the kill and die hook have the id parameter, why are you using for?

old Re: Score, deaths

sheeL
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
addhook("second","OnSecond")
function OnSecond()
for _,id in pairs(player(0,"table")) do
	GetFrag(id)
	end
end

function GetFrag(id)
parse('hudtxt2 '..id..' 0 "©000255000Kills:'..player(id,"score")..'" 10 20')
parse('hudtxt2 '..id..' 1 "©000255000Deaths:'..player(id,"deaths")..'" 10 40')
end

or

1
2
3
4
5
6
7
8
9
10
addhook("kill","OnStats")
addhook("die","OnStats")
function OnStats(id)
	GetFrag(id)
end

function GetFrag(id)
parse('hudtxt2 '..id..' 0 "©000255000Kills:'..player(id,"score")..'" 10 20')
parse('hudtxt2 '..id..' 1 "©000255000Deaths:'..player(id,"deaths")..'" 10 40')
end
edited 1×, last 15.03.13 05:18:55 pm

old Re: Score, deaths

Dousea
User Off Offline

Quote
Didn't tested yet, maybe works.
1
2
3
4
5
6
7
addhook("ms100","player_hud")
function player_hud()
	for _, id in pairs(player(0,"table")) do
		parse('hudtxt '..id..' 0 "'..string.char(169)..'255255255Score: '..player(id,"score")..'" 12 116')
		parse('hudtxt '..id..' 1 "'..string.char(169)..'255255255Deaths: '..player(id,"deaths")..'" 12 130')
	end
end

old Re: Score, deaths

Yates
Reviewer Off Offline

Quote
Guys. STAHP!

1
2
3
4
5
addhook("kill","_kill")
function _kill(killer,victim)
	parse('hudtxt2 '..killer..' 0 "©255255255Score: '..player(killer,"score")..'" 12 115')
	parse('hudtxt2 '..victim..' 1 "©255255255Deaths: '..player(victim,"deaths")..'" 12 130')
end

That's all it is, stop using ms100, always, second it's fucking useless and crap.

And SheeL, jeez man your code does not even have ENDS!

Stop posting crap fixes if you cannot into Lua, learn instead of wasting your time.
edited 1×, last 15.03.13 05:27:23 pm

old Re: Score, deaths

Alistaire
User Off Offline

Quote
Yates going full retard, using hudtxt for a personal kpd counter and shizz

----

1
2
3
4
5
6
7
8
9
10
addhook('kill', 'killHook')

function killhud(id)
	parse('hudtxt2 '..id..' 49 "©220050050K '..player(id, 'score')..' : D '..player(id, 'deaths')..'" 12 116')
end

function killHook(id, victim)
	killhud(id)
	killhud(victim)
end

old Re: Score, deaths

Yates
Reviewer Off Offline

Quote
user Alistaire has written
Yates going full retard

Yates copy/pasting hudtxt code and did not see it was global instead of personal.

Also Yates talking in 3rd person.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview