Garry's Mod

Garry's Mod

HALF-LIFE 2 Team Elimination
正在显示第 31 - 40 项,共 105 项条目
< 1  2  3  4  5  6 ... 11 >
更新于:10 月 31 日 下午 4:50
作者:2cwldys

- Minor bugfixing where antlions weren't spawning using pheropods.

更新于:10 月 31 日 下午 1:15
作者:2cwldys

## IMPORTANT ##

- gm_construct and gm_flatgrass is now immediately redirected by default from the gamemode, can be disabled by placing testing.txt in your garrysmod/data folder
- gm_ prefix is now added to the MapVote rotations

-- Gamemode should refuse to run on gm_flatgrass & gm_construct outside of testing conditions hook.Add("Initialize", "MapRedirectCheck", function() -- Get current map name local currentMap = game.GetMap() -- Check if we're on gm_construct or gm_flatgrass if currentMap == "gm_construct" or currentMap == "gm_flatgrass" then -- Check if testing.txt exists in DATA folder if not file.Exists("testing.txt", "DATA") then print("[Map Redirect] testing.txt not found, redirecting from " .. currentMap) -- Define map prefixes to search for local mapPrefixes = { "te_", "cs_", "de_", "ow_", "owc_", "gm_" } -- Get all available maps using game.GetMapList() -- This returns all maps the server knows about, including workshop maps local allServerMaps = game.GetMapList() local validMaps = {} -- Blacklist maps we don't want to redirect to local blacklistedMaps = { "gm_construct", "gm_flatgrass" } -- Filter maps by our prefixes and exclude blacklisted maps for _, mapName in ipairs(allServerMaps) do -- Check if map is blacklisted local isBlacklisted = false for _, blacklisted in ipairs(blacklistedMaps) do if mapName == blacklisted then isBlacklisted = true break end end -- If not blacklisted, check prefixes if not isBlacklisted then for _, prefix in ipairs(mapPrefixes) do if string.StartWith(mapName, prefix) then table.insert(validMaps, mapName) break -- Don't check other prefixes for this map end end end end -- If we found any maps, pick one and change to it if #validMaps > 0 then local targetMap = validMaps[math.random(1, #validMaps)] print("[Map Redirect] Changing to map: " .. targetMap) print("[Map Redirect] Found " .. #validMaps .. " valid maps total") -- Small delay to ensure everything is initialized timer.Simple(0.1, function() RunConsoleCommand("changelevel", targetMap) end) else print("[Map Redirect] No valid maps found with specified prefixes!") print("[Map Redirect] Total maps available: " .. #allServerMaps) end else print("[Map Redirect] testing.txt found, staying on " .. currentMap) end end end)

更新于:10 月 31 日 上午 12:19
作者:2cwldys

Custom map entities disallowed by the gamemode are removed automatically upon initialization.

- How it works:
It doesn't just bulk remove mapentities_*.txt, instead the code is robust in that it's removed on map initialization, by grabbing the accurate game.GetMap() map name, if it's not in the officially supported open-sourced repository.
https://github.com/2cwldys/hl2te-entitymapedits/

-- Let's ensure custom map entities we don't approve of are CLEARED first thing hook.Add("Initialize", "RemoveDisapprovedEnts", function() ExcludeForbiddenEntEdits() end)
-- Cleanup function that only checks the current map function ExcludeForbiddenEntEdits() if not SERVER then return end if not customEntityMaps then return end local currentMap = game.GetMap():lower() -- gets the current map name local fileName = "mapentities_" .. currentMap .. ".txt" -- Remove the file if this map is not in the maps table if not customEntityMaps[currentMap] and file.Exists(fileName, "DATA") then file.Delete(fileName) print("[MapEntities] Removed " .. fileName .. " (current map not in maps table)") end end

This is done in a fashion to eliminate grief with the map entity adder addon, and preserve edicts in maps. Ensuring only the tested and approved entities are supported by the gamemode in any scenario.

更新于:10 月 30 日 下午 10:29
作者:2cwldys

## DEDICATED SERVER BOONS ##
- More robust admin checks for serverside commands, allowing more dedicated serverside commands accessed by players, admins, and hosts in game; followed by "te_set_"
- update_mapvote_config (console) and !update_mapvote_config added for server admins and server, allowing the server to update and overwrite latest mapvote config with the latest stored in the gamemode code
- !help and !adminhelp added, which tells players which exact chat or console commands are available to them

-- ================================ -- Admin/SuperAdmin Helper Functions -- ================================ local function IsAdminOrSuperAdmin(ply) if not IsValid(ply) then return true end return ply:IsAdmin() or ply:IsSuperAdmin() end local function IsSuperAdminOnly(ply) if not IsValid(ply) then return true end return ply:IsSuperAdmin() end -- Make them global so other files can use them _G.IsAdminOrSuperAdmin = IsAdminOrSuperAdmin _G.IsSuperAdminOnly = IsSuperAdminOnly

更新于:10 月 30 日 下午 10:23
作者:2cwldys

更新于:10 月 30 日 下午 9:56
作者:2cwldys

更新于:10 月 30 日 下午 9:46
作者:2cwldys

更新于:10 月 30 日 下午 9:42
作者:2cwldys

更新于:10 月 30 日 下午 9:36
作者:2cwldys

更新于:10 月 30 日 下午 9:05
作者:2cwldys