Forum

> > CS2D > Scripts > Number Destroy Buildings
Forums overviewCS2D overview Scripts overviewLog in to reply

English Number Destroy Buildings

7 replies
To the start Previous 1 Next To the start

old Number Destroy Buildings

Remulux
User Off Offline

Quote
Hello!Do you know how to change the number of buildings that can destroy your team because it is always after the destruction of 5 you can not destroy more how to change.

old Re: Number Destroy Buildings

EP
User Off Offline

Quote
there's no command for changing what user Remulux wants to change. or at least tell me which is it.. apologies accepted √
edited 1×, last 08.05.13 12:07:50 am

old Re: Number Destroy Buildings

Yates
Reviewer Off Offline

Quote
Weird.

I thought you could change the limit of buildings one may destroy. Seems as though I am wrong.

My most decent apologies and whatever √

old Re: Number Destroy Buildings

EP
User Off Offline

Quote
no problem, well.. the code should be something like this
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
28
29
30
teambuildinglimit = 5

killbuildingscount = {}
for i = 1,32 do
	killbuildingscount[i] = 0
end

addhook("join","_join")
function _join(id)
	killbuildingscount[id] = 0
end

addhook("startround","_startround")
function _startround()
	for i = 1,32 do 
		killbuildingscount[i] = 0
	end
end

addhook("objectkill","_objectkill")
function _objectkill(oid,id)
	local pl = object(oid,"player")
	if pl > 0 and player(pl,"exists") and player(pl,"team") == player(id,"team") then
		killbuildingscount[id] = killbuildingscount[id] + 1
		if killbuildingscount[id] == teambuildinglimit then
			parse("kill "..id)
			killbuildingscount[id] = 0
		end
	end
end

old Thx

Remulux
User Off Offline

Quote
Thanks for help
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview