Jump to content

Writing a gamemode


Paper

Recommended Posts

Hey guys, i'm trying to script a gamemode but i found first problem:

The map cycling... i explain my problem:

I use the function:

exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource()) 

for get all maps compatible whit this gamemode, and it's forlder is called "blabla", now if in the map's meta in the "gamemode" field i put "blabla" as gamemode name this should work right? Instead it wont work...

This is the info tag in the gamemode's meta:

<info author="Paper" version="0.1" type="gamemode" name="blabla" description="" /> 

and this is the test map's meta:

<info gamemodes="blabla" type="map" name="[bLA]Test Map" author="Paper" version="1.0" description=""></info> 

Link to comment
function getMapsForGm( name ) 
    local running = getResourceFromName( name ) or exports.mapmanager:getRunningGamemode( ) 
    if running then 
        return exports.mapmanager:getMapsCompatibleWithGamemode( running ) 
    end 
    return false 
end 

Updated.

Maybe you mean it?

Link to comment

I think Paper want's you to explain why:

exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource()) 

isn't the same as:

function getMapsForGm( name ) 
    local running = getResourceFromName( name ) or exports.mapmanager:getRunningGamemode( ) 
    if running then 
        return exports.mapmanager:getMapsCompatibleWithGamemode( running ) 
    end 
    return false 
end 

Link to comment

Because this:

function getMapsForGm( name ) 
    local running = getResourceFromName( name ) or exports.mapmanager:getRunningGamemode( ) 
    if running then 
        return exports.mapmanager:getMapsCompatibleWithGamemode( running ) 
    end 
    return false 
end 

get maps from name gm or current ( running ) gm.

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