Musamba Posted January 24, 2014 Share Posted January 24, 2014 I don't get why I always get this error: "mapmanager: Invalid map specified" function getRandomMapCompatibleWithGamemode(gamemode) local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(gamemode) if #compatibleMaps == 0 then outputDebugString("CLIMBING: No maps.") return false end local map = compatibleMaps[math.random(1, #compatibleMaps)] if exports["mapmanager"].isMap(map) then return map else outputDebugString("CLIMBING: Map not compatible("..getResourceName(map)..")") return false end end function lastCheckpoint(player) outputChatBox(getPlayerName(player).. " #ffffffhas won the match!", root, 0, 0, 0, true) if not exports["mapmanager"].changeGamemodeMap(getRandomMapCompatibleWithGamemode(getThisResource()), getThisResource()) then outputDebugString("CLIMBING: Map not changed.") end end addEvent("lastCheckpoint", true) addEventHandler("lastCheckpoint", root, lastCheckpoint) 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