Forum

> > CS2D > Scripts > Functions for teams
Forums overviewCS2D overview Scripts overviewLog in to reply

English Functions for teams

10 replies
To the start Previous 1 Next To the start

old Functions for teams

superpegamento
User Off Offline

Quote
First, hello to all

Ok, what I need is really easy, just do not remember the code, I need to spawn with the terrorists have 250HP and CT no take Super Armor.
Thanks in advance

Sorry for my english

old Re: Functions for teams

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("spawn","eh")
function eh(id)
	if player(id,"team")==1 then
		parse("setmaxhealth "..id.." 250")
	end
end

addhook("walkover","col")
function col(id,iid)
	if (player(id,"team")==2 or player(id,"team")==3) and iid == 83 then
		return 1
	end
end

old Re: Functions for teams

Avo
User Off Offline

Quote
@user Rainoth:
1
2
3
4
5
6
addhook("walkover","col")
function col(id, iid, typ)
     if player(id, "team")>=2 and typ == 83 then
          return 1
     end
end
iid isn't a type-id of an item.

old Re: Functions for teams

superpegamento
User Off Offline

Quote
user Avo has written
@user Rainoth:
1
2
3
4
5
6
addhook("walkover","col")
function col(id, iid, typ)
     if player(id, "team")>=2 and typ == 83 then
          return 1
     end
end
iid isn't a type-id of an item.


thanks, how are blocked over 1?

old Re: Functions for teams

Rainoth
Moderator Off Offline

Quote
Sorry, I understand only English,Lithuanian and a bit German , you should rephrase it better...

old Re: Functions for teams

superpegamento
User Off Offline

Quote
user Rainoth has written
Sorry, I understand only English,Lithuanian and a bit German , you should rephrase it better...


mm, no take others items, besides super armor

would need that can not grab super armor and firearms

old Re: Functions for teams

Rainoth
Moderator Off Offline

Quote
What you say contradicts.
"No take other items besides super armor"
> Can take only super armor
"Cannot grab super armor and firearms"
> Can't take super armor

Either explain more detailed (cause I'm suspecting what you mean is team-based picking but I don't know how based) or make up your mind.

old Re: Functions for teams

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
weps = {45,46,47,48,49,83}
addhook("walkover","cantpick")
function cantpick(id,iid,type)
	for k,v in pairs(weps) do
		if type == v then
			return 1
		end
	end
end

This ? Just write item IDs that can't be picked by anyone.

old Re: Functions for teams

Dousea
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local hooks = {"spawn"; "walkover"}
for _, hook in pairs(hooks) do
	addhook(hook, hook .. "hook")
end

function spawnhook (id)
	if (player(id, "team") == 1) then
		parse("setmaxhealth " .. id .. " 250")
	end
end

function walkoverhook (id, iid, type)
	local items = {45; 46; 47; 48; 49; 83}
	if (player(id, "team") >= 2) then
		for _, item in pairs(items) do
			if (type == item) then
				return 1
			end
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview