Jump to content

Help mapmanager


JuniorMelo

Recommended Posts

I am wanting to put this function, to activate only for the team hunter

function changeGamemodeMap_cmd(source, command, ...) 
local team = getPlayerTeam ( source ); 
if ( team == getTeamFromName ( "HUNTER" ) ) then 
    local mapName = #{...}>0 and table.concat({...},' ') or nil 
    source = source or serverConsole 
  
    local map 
    if mapName then 
        map = getMapFromName(mapName) 
        if not isMap(map) then 
            if (refreshResources and hasObjectPermissionTo(getThisResource(), "function.refreshResources", false)) then 
                outputMapManager("'"..mapName.."' is not a valid map.", source) 
            else 
                outputMapManager("'"..mapName.."' is not a valid map. Use the refresh command and try again", source) 
            end 
            return false 
        end 
    else 
        outputMapManager("Usage: /"..command.." map",source) 
        return false 
    end 
  
    local gamemode = currentGamemode 
    if not isGamemode(gamemode) then 
        outputMapManager("No gamemode is running.",source) 
    elseif not isMapCompatibleWithGamemode(map, gamemode) then 
        outputMapManager("Map '"..getResourceName(map).. 
            "' is not compatible with '"..getResourceName(gamemode).."'.",source) 
    else 
        setInstigator( source ) 
        changeGamemodeMap(map, gamemode) 
        end 
    end 
end 

No Work, the screen goes black for another team

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