Offer of new script for "Random Map" mode
Posted: 14 Sep 2018, 11:01
Hello. I've found file of my old server with modified script files of "Random Map" mode. I detected that when somebody sets next map via !setnext command (for example !setnext eagles_2ways_b3) there are still old message in g_msg1 area. So, if you add this code
into "commands.db" file and add this code
into your "randommap.lua" file (or some file, which included into server as Lua Module) you will see, that messages are not obsolete. So, I offer you to make full modify of this file, I see something here is not really need.
It should be very great because when you joining the game and seeing message "The next map is ctf-face-fp1_fixed" you are happy, but when next map is loading you are seeing for example "gold rush".. (i mean server loads some map which you don't like) ...
I have script of PPSH for nitmod. But i can't load it here. If you want this I can send it to you to set it up on server.
- Code: Select all
**********
name = setnextmap
exec = set nextmap "map [1]"; set g_msg1 "^9Next map is ^7[1]"; set nextmapinfo "echo Next map is [1]"; vstr nextmapinfo
desc = Sets the next map
levels = 1 2
into "commands.db" file and add this code
- Code: Select all
function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname("(Map Vote Cycle & Random Map Mode & N!tmod) v1.0")
local maps = {"railgun"}
local maps_excluded = {"mp_bin", "pak0", "pak1", "pak2", "goldendunk_a2", "baserace", "baserace_b3c", "baserace_desert", "ctf-face-fp1_fixed", "purefrag"}
local map_last = et.trap_Cvar_Get("nextmapinfo")
if (map_last ~= "") then
map_last = string.sub(map_last, 18)
end
local map_current = et.trap_Cvar_Get("mapname")
local map_next = ""
if (et.trap_Cvar_Get("warmup") == "1" and (map_last == map_current or map_last == "")) then
et.trap_Cvar_Set("warmup", "0")
local a = io.popen('dir "C:/Users/Admin/Desktop/ALL-OLD/Wolfenstein ET Servers/new/etmain/" /b')
for b in a:lines() do
local c = string.sub(b, 1, string.len(b) - 4)
if (string.sub(b, string.len(b) - 2) == "pk3") then
for d, e in ipairs(maps_excluded) do
if (c == e) then
c = nil
break
end
end
if (c ~= nil) then
table.insert(maps, c)
end
end
end
a:close()
local c = "chat List of maps:\n"
for d, e in ipairs(maps) do
c = c.." chat "..e.."\n"
end
et.trap_Cvar_Set("maplist", c.."chat\n")
while (true) do
map_next = maps[math.random(table.getn(maps))]
if (map_next ~= map_current and map_next ~= map_last) then
break
end
end
et.trap_Cvar_Set("nextmap", "map "..map_next)
et.trap_Cvar_Set("g_msg1", "^9Next map is ^7"..map_next)
et.trap_Cvar_Set("nextmapinfo", "echo Next map is "..map_next)
if (et.trap_Cvar_Get("g_weaponScriptsDir") == "") then
et.trap_Cvar_Set("g_weaponScriptsDir", "g_weaponScriptsDir/default")
end
else
et.trap_Cvar_Set("warmup", "1")
end
end
into your "randommap.lua" file (or some file, which included into server as Lua Module) you will see, that messages are not obsolete. So, I offer you to make full modify of this file, I see something here is not really need.
It should be very great because when you joining the game and seeing message "The next map is ctf-face-fp1_fixed" you are happy, but when next map is loading you are seeing for example "gold rush".. (i mean server loads some map which you don't like) ...
I have script of PPSH for nitmod. But i can't load it here. If you want this I can send it to you to set it up on server.