Jump to content

Map shop


Recommended Posts

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 
        local infoNode = xmlFindChild(meta, 'info', 0) 
        local info = infoNode and xmlNodeGetAttributes ( infoNode ) or {} 
        local map = setmetatable({ info = info },RaceMap) 
        return map 
function loadToptimes(mapName) 
    toptimes = {} 
    local mode = 'Destruction Derby' 
    local sqlResults = executeSQLQuery('SELECT * FROM '..makeDatabaseTableName(mode,mapName)) 
    if not sqlResults then 
        return false 
    toptimes = {} 
    for r,sqlRow in ipairs(sqlResults) do 
        local row = {} 
        for c,column in ipairs(columns) do 
            row[column] = sqlRow[column] 
        table.insert( toptimes, row ) 
    return toptimes 

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...