Forum

> > CS2D > Scripts > Team image
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Team image

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Team image

J4x
User Off Offline

Zitieren
Hello everyone, I have a doubt about a script, how do I make an image is visible for one team only? I mean if ct activate the image only ct can see it and if t activate only t can see it.

- Thanks, Pwnisher

alt Re: Team image

TimeQuesT
User Off Offline

Zitieren
after the 'mode' parameter in the "image" command you can specific which player can see it. Just table everyplayer, check the team and place / update the image.

edit:
cs2d lua cmd image
1× editiert, zuletzt 21.10.12 20:14:24

alt Re: Team image

Starkkz
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
function TeamImage(path,x,y,mode,team)
	local image_list = {}
	for _, id in pairs(player(0,"table")) do
		if player(id,"team") == team then
			table.insert(image_list, image(path, x, y, mode, id))
		end
	end
	return image_list
end

Take care, the function that I gave you returns a table with the list of the IDs of every image... you also have to check when the player changes of team, because the image will be still there

alt Re: Team image

J4x
User Off Offline

Zitieren
Thanks, the starkkz solution seems to be the best.

alt Re: Team image

sheeL
User Off Offline

Zitieren
user Starkkz hat geschrieben
1
2
3
4
5
6
7
8
9
function TeamImage(path,x,y,mode,team)
	local image_list = {}
	for _, id in pairs(player(0,"table")) do
		if player(id,"team") == team then
			table.insert(image_list, image(path, x, y, mode, id))
		end
	end
	return image_list
end

Take care, the function that I gave you returns a table with the list of the IDs of every image... you also have to check when the player changes of team, because the image will be still there


Start round hook?
If not For Team Player, Remove Image
is example..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook('startround','_round')


function _checkteam(id)
xyz = player(id,"team")
 if xyz == 1 then
 --ACTIONS
 --ex : msg2(id,"TR")
 -- blabla free image ...
 -- blabla image..
 return 1
end
 if xyz == 2 then
 --ex : msg2(id,"CT")
 -- blabla free image ...
 -- blabla image..
 return 1
 end
end

function _round(id)
 _checkteam(id)
end
1× editiert, zuletzt 21.10.12 20:48:37
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht