Forum

> > CS2D > Scripts > Building team detection
Forums overviewCS2D overview Scripts overviewLog in to reply

English Building team detection

3 replies
To the start Previous 1 Next To the start

old Building team detection

DarkLight66
User Off Offline

Quote
Hi, does anyone know how to detect the team on with a building is without it having an owner?, i tried with object(id,"team") but it returns a boolean value with is false when the building don´t have a team (yellow one).

old Re: Building team detection

Apache uwu
User Off Offline

Quote
Object(id,"team") will either return 2 type values...

A boolean--false or a int <0,>32

When a building doesn't have a owner that function will return false.

And when there is one it returns the id.

1
2
3
4
5
if object(id,"team")>0 then
		--use team
	else
		--no owner
	end

old Re: Building team detection

DarkLight66
User Off Offline

Quote
@Textual Context: Yeah, but when i use object(id,"team") and the team of the building is either Ct or T, and the building doesn´t have an owner, it returns true, but when the team is 0, it returns false.
The thing is, i want to detect the team of the turret, like if it´s CT or T, when the turret doesn´t have an owner.

old Re: Building team detection

DC
Admin Off Offline

Quote
I checked that out and.. sorry: the "team" Lua return value for cs2d lua cmd object is bugged. it returns a boolean but is supposed to return an integer for obvious reasons. thanks.

will be fixed for the next release.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview