Forum

> > CS2D > Scripts > Get button's settings
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Get button's settings

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Get button's settings

Mami Tomoe
User Off Offline

Zitieren
How to get a button's settings?
Like to know if it's CT/T only or everyone and more things?

1
2
3
4
for i = 0, 9 do
		msg(tostring(entity(x, y, "int["..i.."]")))
		msg(tostring(entity(x, y, "str["..i.."]")))
	end

This leads to a whole bunch of
false
s.

alt Re: Get button's settings

DC
Admin Off Offline

Zitieren
See cs2d entity trigger_use (bottom section).

It's indeed without the [] so this should work:
1
2
3
4
for i = 0, 9 do
	msg(tostring(entity(x, y, "int"..i)))
	msg(tostring(entity(x, y, "str"..i)))
end

If it's returning just "false" it either means that
:x: the parameter you passed in (intX, strX) is unknown
:x: or the entity does not exist (x, y must be the tile position of an existing entity)

Otherwise strX should return an empty string and intX just 0 even if the value is not set/used for that specific entity type.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht