(s)ection Posted October 2, 2014 Share Posted October 2, 2014 how get maps + author and how start random map without vote ???? thx Link to comment
ma2med Posted October 2, 2014 Share Posted October 2, 2014 function table.random ( theTable ) return theTable[math.random ( #theTable )] end function getMaps() local resources = getResources() local tablemaps = {} for i,map in ipairs(resources) do if getResourceInfo(map,"type") == "map" and getResourceState(map) == "loaded" then table.insert(tablemaps,map) end end return tablemaps end function startRandomMap() local maprandom = table.random(getMaps()) startResource(maprandom) end Link to comment
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