Hello.
I want to make a blacklist in my votemap, I wrote this code:
[lua]
local goodmaps = {}
local servermaps = {}
servermaps = file.Find("maps/*.bsp","GAME")
local blacklist = {"deathrun_", "cs_", "gm_", "dr_", "de_", "ph"}
table.Add(servermaps, file.Find(string.format("gamemodes/%s/content/maps/*.bsp",gmod.GetGamemode().FolderName),"GAME"))
for k,v in pairs(servermaps) do
for l,m in pairs(blacklist) do
if not string.match(v,m) then table.insert(goodmaps,string.lower(string.sub(v,0,v:len() - 4))) break end
end
end
[/lua]
I don't know why this blacklist doesn't work.
Some help?
no one?
You loop through the servermaps, then loop through the blacklist, and add all maps to the goodmaps, you aint blacklisting at all. Fix your code, or overall learn the basics of Lua.
[url]https://www.lua.org/pil/19.2.html[/url]
Sorry, you need to Log In to post a reply to this thread.