'LinKin Posted March 17, 2014 Posted March 17, 2014 Hello, I want to make a GUI so that it displays a list of all maps compatible with Race gamemode. (Only Race). Which stuff should I use to get those maps? Also, to order them alphabetically in the GUI. Thanks. Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
JR10 Posted March 17, 2014 Posted March 17, 2014 Try this: local raceMaps = {} addEventHandler('onResourceStart', resourceRoot, function() for index, resource in pairs(getResources()) do if (getResourceInfo(resource, "type") == "map" and string.find(getResourceInfo(resource, "gamemodes") or "", "race") then table.insert(raceMaps, resource) end end end) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
'LinKin Posted March 17, 2014 Author Posted March 17, 2014 Hmm, I remember some function that was smth like this: getMapsCompatibleWithGamemode(getRunningGamemode()). Also, how to sort them alphabetically? Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
JR10 Posted March 17, 2014 Posted March 17, 2014 That's an exported function in the mapmanager resource, you can also use that. Here's how to sort the raceMaps table: table.sort(raceMaps, function(a, b) return getResourceName(b) > getResourceName(a) end) Not tested but should work. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now