StreetSaintz Posted September 8, 2014 Share Posted September 8, 2014 Hey, i have a map uploader but the problem is it is working with sql and i just need it to take the maps from gamemodes/race/maps/ instead out of the database function load(res) --Check if there are any .'s by using the real element system first local resourceRoot = getResourceRootElement(res) --Spawnpoints are contained within the MTA map, therefore lets assume only MTA maps were used (removes general.ModifyOtherObjects dependency) local meta = xmlLoadFile(':' .. getResourceName(res) .. '/' .. 'meta.xml') if not meta then return false end local infoNode = xmlFindChild(meta, 'info', 0) local info = infoNode and xmlNodeGetAttributes ( infoNode ) or {} xmlUnloadFile(meta) local map = setmetatable({ info = info },RaceMap) return map end function loadToptimes(mapName) toptimes = {} local mode = 'Destruction Derby' local sqlResults = executeSQLQuery('SELECT * FROM '..makeDatabaseTableName(mode,mapName)) if not sqlResults then return false end toptimes = {} for r,sqlRow in ipairs(sqlResults) do local row = {} for c,column in ipairs(columns) do row[column] = sqlRow[column] end table.insert( toptimes, row ) end return toptimes 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