Forum

> > CS2D > Scripts > Building team detection
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Building team detection

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Building team detection

DarkLight66
User Off Offline

Zitieren
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).

alt Re: Building team detection

Apache uwu
User Off Offline

Zitieren
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

alt Re: Building team detection

DarkLight66
User Off Offline

Zitieren
@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.

alt Re: Building team detection

DC
Admin Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht