Jump to content

Set next map


audi868

Recommended Posts

Any help?

It is returning errors at setting cmd.

function nextmap(source,cmd,...) 
    nextmapname = table.concat({...}," ") 
    for k,v in ipairs(getResources()) do 
    local name = getResourceInfo(v,'name') 
    if name == nextmapname then 
    nextmap = v 
    end 
    end 
    outputChatBox("Nextmap set to "..getResourceName(nextmap),source) 
end 
addCommandHandler("nm",nextmap) 
  
addEvent("onGamemodeMapStop") 
addEventHandler("onGamemodeMapStop",root,function() 
        if not (nextmap) == nil then 
        local map = nextmap 
        startResource(map) 
        nextmap = nil 
        end 
    end 
) 

Link to comment
function nextmap(source,cmd,...) 
    nextmapname = table.concat({...}," ") 
    nextmap = nil 
    for k,v in ipairs(getResources()) do 
        local name = getResourceInfo(v,'name') 
        if name == nextmapname then 
            nextmap = v 
        end 
    end 
    if nextmap then 
        outputChatBox("Nextmap set to "..getResourceName(nextmap),source) 
    end 
end 
addCommandHandler("nm",nextmap) 
  
addEvent("onGamemodeMapStop") 
addEventHandler("onGamemodeMapStop",root,function() 
        if (nextmap) then 
        local map = nextmap 
        startResource(map) 
        nextmap = nil 
        end 
    end 
) 

Edited by Guest
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...