Arizard / deathrun

Arizard's Deathrun gamemode for Garry's Mod
63 stars 38 forks source link

Hooks and Convars #153

Open dfsss1 opened 4 years ago

dfsss1 commented 4 years ago

How can i change the amount of rounds of a SPECIFIC map??? Because i want to change the time and the rounds only for a specific map but i don't know how… if anyone help me with that i'be very happy… Thanks btw.!

Zulbem commented 4 years ago

just made this, should do the job. Create a file in lua > autorun > server > filename.lua and paste it in there.

local maplimits = { -- Add maps and round limits here
    {
        mapname = "deathrun_example_map",
        maprounds = 2
    },
    {
        mapname = "deathrun_example_map2",
        maprounds = 5
    }
}

hook.Add( "InitPostEntity", "customroundlimits", function()
    local map = tostring( game.GetMap() )

    for i=1, #maplimits do
        if map == maplimits[i].mapname then
            RunConsoleCommand( "deathrun_round_limit", maplimits[i].maprounds )
            return
        end
    end
end)
ceifa commented 4 years ago

MapSettings do the job. Create the mapsettings directory and your map files, example:

mapsettings/deathrun_atomic_warfare.lua:

RunConsoleCommand("deathrun_round_limit", 20)
SoflyTtv commented 3 years ago

so we make a file in maps or in the gamemode files

ceifa commented 3 years ago

so we make a file in maps or in the gamemode files

In gamemode/mapsettings