Jump to content

Map Shop - Race


'LinKin

Recommended Posts

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) 
  

Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...