Forum

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

Englisch loop for hudtxt

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt loop for hudtxt

Harmoni
User Off Offline

Zitieren
Hi all, i want to add all terrorist player in to hudtxt. For example there are 5 players in terrorist so there will be 5 hudtxt in the screen may you help me ?

alt Re: loop for hudtxt

Harmoni
User Off Offline

Zitieren
I want to it to left side on the screen and i want to see terrorist names who has kill score >= 2 for example in the teror team we have 4 players and their names is "player1,player2,player3,player4" if just player1 have 2 kills or more so there will be just this hudtxt

Terrorist: player1

If all terrorist have 2 or more kill score so there will be thesee hudtxts

Terrorist: player1
Terrorist: player2
Terrorist: player3
Terrorist: player4

Thank you.

alt Re: loop for hudtxt

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
posX_CT = 30 'change however you like
posX_T = 270 'here too
posY_CT = 30
posY_T = 30
hudID = 0
addhook("startround","woosh")
function woosh(mode)
	posX_CT = 30 'change however you like
	posX_T = 270 'here too
	posY_CT = 30
	posY_T = 30
	hudID = 0
	for k,v in pairs (player(0,"team1living")) do
		if player(v,"score") >= 2 then
			('hudtxt '..hudID..' "\169255000000Terrorist: '..player(v,"name")..'" '..posX_T..' '..posY_T..' 0')
			posY_T = posY_T + 15
			hudID = hudID + 1
		end
	end
	for k,v in pairs (player(0,"team2living")) do
		if player(v,"score") >= 2 then
			('hudtxt '..hudID..' "\169000000255Counter-Terrorist: '..player(v,"name")..'" '..posX_CT..' '..posY_CT..' 0')
			posY_CT = posY_CT + 15
			hudID = hudID + 1
		end
	end
end

Not tested cuz I wrote in a hurry (got to go now...)

alt Re: loop for hudtxt

Harmoni
User Off Offline

Zitieren
LUA ERROR: sys/lua/test.lua:16: syntax error near 'posY_T'



1
Line 16: posY_T = posY_T + 15

I checked the variables the are same. But there is syntax error.

alt Re: loop for hudtxt

TopNotch
User Off Offline

Zitieren
@user Harmoni: RM forgot "parse" twice. And remove the suposed to be comments.
1
parse('hudtxt '..hudID..' "\169255000000Terrorist: '..player(v,"name")..'" '..posX_T..' '..posY_T..' 0')
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht