Forum

> > CS2D > Scripts > Team image
Forums overviewCS2D overview Scripts overviewLog in to reply

English Team image

4 replies
To the start Previous 1 Next To the start

old Team image

J4x
User Off Offline

Quote
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

old Re: Team image

TimeQuesT
User Off Offline

Quote
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
edited 1×, last 21.10.12 08:14:24 pm

old Re: Team image

Starkkz
Moderator Off Offline

Quote
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

old Re: Team image

J4x
User Off Offline

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

old Re: Team image

sheeL
User Off Offline

Quote
user Starkkz has written
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
edited 1×, last 21.10.12 08:48:37 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview