Forum

> > CS2D > Scripts > unbuildable for tt
Forums overviewCS2D overview Scripts overviewLog in to reply

English unbuildable for tt

8 replies
To the start Previous 1 Next To the start

old unbuildable for tt

lennon
User Off Offline

Quote
Well i was tried to make unbuildable for example turret for tt and i dont know how? Any idea?

old Re: unbuildable for tt

Talented Doge
User Off Offline

Quote
1
2
3
4
5
addhook("buildattempt", "_build")

function _build(p)
	if player(p, "team") == 1 then return 1 end
end

Easy stuff that can be done within 30 seconds.

old Re: unbuildable for tt

Rainoth
Moderator Off Offline

Quote
cs2d lua hook buildattempt
+
1
2
3
4
5
6
if type == 8 then -- If turret
	if player(id,"team") == 1 then -- If terrorist
		msg2(id,"Terrorists can't build")
		return 1 -- Don't build
	end
end

old Re: unbuildable for tt

Talented Doge
User Off Offline

Quote
user Rainoth, your version would be

1
2
3
4
5
6
7
8
addhook("buildattempt", "_build")

function _build(p)
if player(id,"team") == 1 then
     msg2(id,"Terrorists can't build")
end
return 1
end

This will disable all building attempts.

EDIT: okay i've seen your latest edit

Admin/mod comment

I meant to write it as a "+ return 1" but I was too lazy and that happened. Well... I guess you got ninja'd. /user Rainoth

old Re: unbuildable for tt

The Gajos
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
addhook('build','_build')
function _build(id,type,x,y,mode,objectid)
	if player(id,'team') == 1 then
		if type == 8 then
			return 1
		end
	end
end

old Re: unbuildable for tt

TopNotch
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
unbuildables = {5, 8}

addhook("build","_build")
function _build(id, type)
	if player(id,"team") == 1 then
		for _, i in pairs(unbuildables) do
			if type == i then
				msg2(id,"\169255000000Terrorists can\'t build this.")
				return 1
			end
		end
	end
end
Just place the ID's of the objects in the 'unbuildables' table (ID's).

old Re: unbuildable for tt

Talented Doge
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
unbuildable = {
[1] = true;
[2] = true;
[3] = true;
}

addhook("buildattempt", "_bld")

function _bld(p, t)
	if player(p, "team") == 1 and unbuildable[t] then msg2(p, "\169255000000You can't build this!") return 1 end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview