Forum

> > CS2D > Scripts > Team score :d
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Team score :d

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

alt Team score :d

Suprise
BANNED Off Offline

Zitieren
Sorry for script question but now im learning! So :

I need a startround script! When start the server or map then the next write: Example:
Hudtxt blabla Counter terrorist: CTSCORES
Hudtxt blabla Terrorists: TSCORES

Or zombie;survivor!

Ty in advance :d

alt Re: Team score :d

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
addhook("startround","showscores")
function showscores()
	parse("hudtxt 1 \"©255000000T Score:"..game("score_t").."\" 200 5")
	parse("hudtxt 2 \"©000000255CT Score:"..game("score_ct").."\" 400 5")
end

showscores()

alt Re: Team score :d

Big Bang Mafia
User Off Offline

Zitieren
user EngiN33R
i tested the script and it gives weird problem on line 1 lol

Console hat geschrieben
LUA ERROR: sys/lua/build.lua:1: unexpected symbol near 'ï'


don't worry about the name 'build.lua' i just replaced a script with this one

alt Re: Team score :d

EngiN33R
Moderator Off Offline

Zitieren
Well, for goodness' sake, what's the line 1? Specify the line text whenever you have an error with a line number.

alt Re: Team score :d

EngiN33R
Moderator Off Offline

Zitieren
What the fuck is wrong with the errors people are getting? Honestly. Are you sure that's line 1?

alt Re: Team score :d

Big Bang Mafia
User Off Offline

Zitieren
the whole code

1
2
3
4
5
6
7
addhook("startround" , "showscores")
function showscores()
     parse("hudtxt 1 \"©255000000T Score:"..game("score_t").."\" 200 5")
     parse("hudtxt 2 \"©000000255CT Score:"..game("score_ct").."\" 400 5")
end

showscores()

alt Re: Team score :d

Hador
User Off Offline

Zitieren
something tells me that that is not the complete code. You gave an error message obviously stating a problem near an "i" in line one; however line 1 does not seem to contain a "i". Either you have not showed us the complete contents of the "build.lua" (or have not saved it), or there is some major problem with the lua engine in cs2d. I suspect the first.
1× editiert, zuletzt 05.03.12 22:19:03

alt Re: Team score :d

Big Bang Mafia
User Off Offline

Zitieren
i showed the complete script.. really i think there's a problem with cs2d lua engine.

EDIT: this is not the only script that get's that problem, some other script's have a problem at line 1 that im using

alt Re: Team score :d

sheeL
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
addhook ("startround", "showscores") 
função showscores () 
if player(id,"exists") then
parse ("hudtxt2 "..id.." 1 \ T Score ©255000000".. jogo (" score_t ") .." \ "200 5") 
parse ("hudtxt2 "..id.." 2 \ CT Score ©000000255".. jogo (" score_ct ") .." \ "400 5") 
end
end
showscores ()

alt Re: Team score :d

EngiN33R
Moderator Off Offline

Zitieren
@user Anders4000: Actually, I do. The hook is startround - sometimes, the execution of a script is not the round beginning. To compensate for that, I call it directly in the script. One step ahead.

alt Re: Team score :d

MikuAuahDark
User Off Offline

Zitieren
user EngiN33R hat geschrieben
1
2
3
4
5
6
7
addhook("startround","showscores")
function showscores()
	parse("hudtxt 1 \"©255000000T Score:"..game("score_t").."\" 200 5")
	parse("hudtxt 2 \"©000000255CT Score:"..game("score_ct").."\" 400 5")
end

showscores()

your code is not work, it not showing the score, i test it. also if only called 1 time, im sure the score is stays, so the code below maybe work!
@user Suprise: maybe this works!
1
2
3
4
5
6
7
8
9
ts = 0
cts = 0
addhook("kill","lol")
function lol(id)
	if player(id,"team")==1 then ts = ts+1 end
	if player(id,"team")==2 then cts = cts+1 end
	parse("hudtxt 1 \"©255000000T Score:"..ts.."\" 200 5")
	parse("hudtxt 2 \"©000000255CT Score:"..cts.."\" 400 5")
end

alt Re: Team score :d

EngiN33R
Moderator Off Offline

Zitieren
user MikuAuahDark hat geschrieben
user EngiN33R hat geschrieben
1
2
3
4
5
6
7
addhook("startround","showscores")
function showscores()
	parse("hudtxt 1 \"©255000000T Score:"..game("score_t").."\" 200 5")
	parse("hudtxt 2 \"©000000255CT Score:"..game("score_ct").."\" 400 5")
end

showscores()


I just tested it and it works.

user MikuAuahDark hat geschrieben
also if only called 1 time, im sure the score is stays, so the code below maybe work!


If you honestly believe that - you need to learn CS2D Lua a little. A hook automatically parses a function when the hook event happens - thus, the showscores() function is executed manually once when the script starts, but then it's automatically executed every round start.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht