Jump to content

Set Next map via AdminPanel (Sigmar)


Recommended Posts

Hi every one, im triying to edit sigmar, to put it on my server :( but i dont get the "set map" i got this fail:

[2014-07-30 13:32:38] ERROR: [gamemodes]\[MultigamemodeS]\sigmar\server.lua:1190: attempt to concatenate global 'accName' (a nil value) 

Here is that i used to "setmap"

addCommandHandler('nextmap', 
    function( player, command, ... ) 
        local query = #{...}>0 and table.concat({...},' ') or nil 
        if not query then 
            if g_ForcedNextMap then 
                outputRace( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) 
            else 
                outputRace( 'Next map is not set', player ) 
            end 
            return 
        end 
        local admin = false 
        if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
            admin = true 
        end 
        if not _TESTING and admin == false then 
            return 
        end 
        local map, errormsg = findMap( query ) 
        if not map then 
            outputRace( errormsg, player ) 
            return 
        end 
        if g_ForcedNextMap == map then 
            outputRace( 'Next map is already set to ' .. getMapName( g_ForcedNextMap ), player ) 
            return 
        end 
        g_ForcedNextMap = map 
        outputChatBox('Next map set to ' .. getMapName( g_ForcedNextMap ) .. ' by ' .. getPlayerName( player ), g_Root, 0, 240, 0) 
    end 
) 

Link to comment

Is this hard for you ?

addCommandHandler('nextmap', 
    function( player, command, ... ) 
        local query = #{...}>0 and table.concat({...},' ') or nil 
        if not query then 
            if g_ForcedNextMap then 
                outputRace( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) 
            else 
                outputRace( 'Next map is not set', player ) 
            end 
            return 
        end 
        local admin = false 
        local accName = getAccountName( getPlayerAccount( player ) ) 
        if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
            admin = true 
        end 
        if not _TESTING and admin == false then 
            return 
        end 
        local map, errormsg = findMap( query ) 
        if not map then 
            outputRace( errormsg, player ) 
            return 
        end 
        if g_ForcedNextMap == map then 
            outputRace( 'Next map is already set to ' .. getMapName( g_ForcedNextMap ), player ) 
            return 
        end 
        g_ForcedNextMap = map 
        outputChatBox('Next map set to ' .. getMapName( g_ForcedNextMap ) .. ' by ' .. getPlayerName( player ), g_Root, 0, 240, 0) 
    end 
) 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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