Forum

> > CS2D > Scripts > Load maps in a lua Menu
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Load maps in a lua Menu

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Load maps in a lua Menu

DragonAwper
User Off Offline

Zitieren
Script that loads all maps that i have in
map folder (cs2d/maps/) in a menu

i tried to made but i don't know how to list the names in a menu

1.Is it possible?
2.How to Make it?

Thanks a lot.

alt Re: Load maps in a lua Menu

Yates
Reviewer Off Offline

Zitieren
Oh. Wait, am I reading this correctly now? He wants a lua that checks all his maps and puts them into a menu?!

alt Re: Load maps in a lua Menu

Apache uwu
User Off Offline

Zitieren
Here you go. Organizing from table/array to menu/gui is up to you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
os.execute('dir "maps" > tmp') --windows
os.execute('ls -a1 "maps" > tmpmap') --unix

maps={}
for file in io.lines("tmp") do
	if file:sub(-4) == ".map" then
		table.insert(maps,string.sub(file,40,-5))
	end
end

os.execute('del tmp') --windows
os.execute('rm tmp') --unix

for _,map in ipairs(maps) do
	msg(map) --showing that it works
end

alt Re: Load maps in a lua Menu

Apache uwu
User Off Offline

Zitieren
So you want to list a large number of items and have a less and more button to navigate through the items? Your last post was really bad at explaining that.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht