You are not logged in.
Pages: 1
Hi,
I have a question about this server.cfg and fcvars.cfg. My cannisterkick and owner are both set to 1. If i try to kick a cannister it stays in the same position and won't move. Do you guys have any tips on improving my cfg and fcvars for example reduce lag or improve settings ect. I also hve all voting dissabled but there are still some things i can vote for.. anyone know how to dissable all voting? Thanks in advance.
Dennis
// PASSWORDS & CLIENTS
set g_password "" // set to password protect the server
set sv_privateclients "0" // if set > 0, then this number of client slots will be reserved for connections
set sv_privatepassword "" // that have "password" set to the value of "sv_privatePassword"
set rconpassword "" // remote console access password
set refereePassword "" // referee status password// DL, RATE
set sv_maxRate "40000" // 10000 standard but poor for ET
set sv_dl_maxRate "42000" // increase/decerease if you have plenty/little spare bandwidth
set sv_allowDownload "1" // global toggle for both legacy download and web download
set sv_wwwDownload "1" // toggle to enable web download
set sv_wwwBaseURL "http://fdl.fragwise.eu/et/5.39.188.179_27050/" // base URL for redirection
set sv_wwwDlDisconnected "0" // tell clients to perform their downloads while disconnected from the server
set sv_wwwFallbackURL "" // URL to send to if an http/ftp fails or is refused client side// MOTD ETC
set sv_hostname "^1E^7T^4c^8|^1D^2E^3N^4N^5I^6S" // name of server here
set server_motd0 " ^NEnemy Territory ^7MOTD " // message in right corner of join screen here
set server_motd1 ""
set server_motd2 ""
set server_motd3 ""
set server_motd4 ""
set server_motd5 ""// MISC SETTINGS
set g_heavyWeaponRestriction "100"
set g_antilag "1"
set g_altStopwatchMode "0"
set g_autofireteams "1"
set g_complaintlimit "6"
set g_ipcomplaintlimit "3"
set g_fastres "0"
set g_friendlyFire "416"
//set g_gametype "4" // Game type should be set from map rotation script
set g_minGameClients "8"
set g_maxlives "0"
set g_alliedmaxlives "0"
set g_axismaxlives "0"
set g_teamforcebalance "1"
set g_noTeamSwitching "0"
set g_voiceChatsAllowed "4"
set g_doWarmup "0"
set g_warmup "30"
set g_spectatorInactivity "0"
set sv_floodProtect "1"
set sv_allowDownload "1"
set sv_pure "1"
set sv_minping "0"
set sv_maxping "0"
set match_latejoin "1"
set match_minplayers "4"
set match_mutespecs "0"
set match_readypercent "100"
set match_timeoutcount "0"
set match_warmupDamage "1"
set team_maxplayers "0"
set team_nocontrols "1"
set pmove_fixed "0"
set pmove_msec "8"// DENNIS92NL
set team_maxTripmines "10"
set team_maxLandmines "20"
set team_maxMedics "2"
set team_maxFieldops "2"
set team_maxSoldiers "2"
set team_maxPanzers "1"
set team_maxFlamers "1"
set g_shove "180"
set g_fixedphysics "1"
set g_fixedphysicsfps "125"
set sv_fps "20"
set g_medics "8"
set ip_max_clients "4"
set g_constructiblexpsharing "1"
set g_canisterKick "1"
set g_classChange "1"
set g_doubleJump "1"
set g_missileCams "7"
set g_announcer "127"
set g_multikillTime "2000"
set g_XPSave "15"
set g_adrenClasses "31"
set g_weaponItems "2"
set g_DJHeight "1.5"
set g_shortcuts "1"
set g_antiwarp "1"
set g_spawnInvul "3"
set g_intermissionTime "60"
set g_intermissionReadyPercent "100"
set g_goombaFlags "25"
set g_revenge "1"
set g_weapons "63391"
set g_userAlliedRespawnTime "8"
set g_userAxisRespawnTime "8"
set n_UserDBSync "1"
set n_SQLiteDBPath "/gs/et/srv307/nitmod/NITMOD_DB.sqlite"
set lua_modules "rspree.lua connect.lua"
set n_NxAC "1"
set g_customConfig "fcvars.cfg"
set g_dualSMG "3"
set g_realHead "1"
set g_playDead "1"
set g_dragCorpse "1"
set g_pickAnyWeapon "1"
set g_asblock "1"
set g_gravity "900"
set g_speed "420"
set g_fieldOps "2"
set n_reviveSpreeOptions "31"
set n_multiReviveTime "2000"
set g_throwDistance "500"
set n_dynamiteTimer "30000"
set g_countryflags "1"
set n_userMail "1"
set n_mapRecords "1"
set n_killAssistances "1"
set n_mapRecords "1"
set g_dropAmmo "5"
set g_dropHealth "5"
set g_medicChargeTime "15000"
set g_engineerChargeTime "15000
set g_LTChargeTime "15000"
set g_soldierChargeTime "15000"
set g_covertopsChargeTime "15000"set skill_soldier "2 4 6 8 10"
set skill_medic "2 4 6 8 10"
set skill_engineer "2 4 6 8 10"
set skill_fieldops "2 4 6 8 10"
set skill_covertops "2 4 6 8 10"
set skill_battlesense "2 4 6 8 10"
set skill_lightweapons "2 4 6 8 10"sets sl_clanid "113208"
sets tb_clanid "27"
sets _Admin "^1E^7T^4c^8|^1D^2E^3N^4N^5I^6S"// BANNER
set g_msgpos "2" //Banners location (see g_msgs)
set g_msgs "120" //Delay, in seconds, between banner messages. (see g_msgpos)
set g_msg1 "^6XPSAVE"
set g_msg2 "^1!RSPREES !SPREE_RECORD"// OMNIBOT
set omnibot_enable "1"
set omnibot_flags "65"
set omnibot_path "/gs/et/srv307/omni-bot// VOTING
set g_allowVote "0"
set vote_limit "0"
set vote_percent "0
set vote_allow_comp "0
set vote_allow_gametype "0
set vote_allow_kick "0
set vote_allow_map "0
set vote_allow_matchreset "0
set vote_allow_mutespecs "0
set vote_allow_nextmap "0
set vote_allow_pub "0"
set vote_allow_referee "0"
set vote_allow_shuffleteams "0"
set vote_allow_swapteams "0"
set vote_allow_friendlyfire "0"
set vote_allow_timelimit "0"
set vote_allow_warmupdamage "0"
set vote_allow_antilag "0"
set vote_allow_balancedteams "0"
set vote_allow_muting "0"// LOGGING
set g_log "etserver.log" // Game logging
set g_logsync 0
set logfile 0 // Console logging ( 1: enable 2: enable and sync )// MAP ROTATION
exec objectivecycle.cfg // Objective mode
// WATCHDOG
// in case the game dies with an ERR_DROP
// or any situation leading to server running with no map
//set com_watchdog 10 // defaults 60
set com_watchdog_cmd "exec objectivecycle.cfg" // defaults to quit
configname "Cvars restrictions"
init
{
command "sv_cvarempty"
command "forcecvar snaps 20"
command "sv_cvar cg_fov IN 90 120"
command "forcecvar r_ambientScale 0.5"
command "forcecvar rate 25000"
command "forcecvar cl_maxpackets 100"
command "forcecvar r_colorMipLevels 0"
command "forcecvar r_drawentities 1"
command "forcecvar r_drawworld 1"
command "forcecvar r_lightmap 0"
command "forcecvar r_showmodelbounds 0"
command "forcecvar r_wolffog 0"
command "sv_cvar r_primitives IN 0 2"
command "forcecvar cl_freelook 1"
command "forcecvar cl_pitchspeed 0"
command "forcecvar cl_yawspeed 0"
command "forcecvar cl_timenudge 0"
command "forcecvar r_zfar 0"
command "sv_cvar com_maxfps IN 40 125"
command "forcecvar r_showtris 0"
command "forcecvar r_znear 3"
}
Last edited by Dennis92NL (21-Sep-16 13:13:09)
Offline
set this higher or lower.
set g_canisterKick "50"
set g_canisterKickOwner "1"
votes off
//////////////////////////////Toggle "Competition Settings" voting (requires default_comp.cfg on the server)
set vote_allow_comp "0"
//////////////////////////////Toggle gametype voting
set vote_allow_gametype "0"
//////////////////////////////Toggle voting to kick players
set vote_allow_kick "0"
//////////////////////////////Toggle map voting
set vote_allow_map "0"
//////////////////////////////Toggle match reset voting
set vote_allow_matchreset "0"
//////////////////////////////Toggle voting to mute spectators
set vote_allow_mutespecs "0"
//////////////////////////////Toggle nextmap voting
set vote_allow_nextmap "0"
//////////////////////////////Toggle "Public Settings" voting (requires default_pub.cfg on the server)
set vote_allow_pub "0"
//////////////////////////////Toggle voring to referee players
set vote_allow_referee "0"
//////////////////////////////Toggle voting to shuffle teams & restart match
set vote_allow_shuffleteams "0"
//////////////////////////////Toggle voting to shuffle teams WITHOUT restarting match
set vote_allow_shuffleteams_norestart "0"
//////////////////////////////Toggle voting to swap teams WITHOUT restarting match
set vote_allow_swapteams "0"
//////////////////////////////Toggle voting to swap teams & restart match
set vote_allow_swapteamsrestart "0"
//////////////////////////////Toggle Friendly Fire voting
set vote_allow_friendlyfire "0"
//////////////////////////////Toggle voting to modify timelimit
set vote_allow_timelimit "0"
//////////////////////////////Toggle voting to modify warmup damage settings
set vote_allow_warmupdamage "0"
//////////////////////////////Toggle voting to modify antilag status
set vote_allow_antilag "0"
//////////////////////////////Toggle voting to modify balanced teams status
set vote_allow_balancedteams "0"
//////////////////////////////Toggle voting to mute players
set vote_allow_muting "0"
//////////////////////////////Toggle voting to surrender
set vote_allow_surrender "0"
//////////////////////////////Toggle campaing restart voting
set vote_allow_restartcampaign "0"
//////////////////////////////Toggle next campaign voting
set vote_allow_nextcampaign "0"
//////////////////////////////Toggle Poll voting
set vote_allow_poll "0"
//////////////////////////////Allow the vote to restart the map
set vote_allow_maprestart "0"
//////////////////////////////Maximum number of votes a player can call per map.
set vote_limit "1"
//////////////////////////////Percentage of "YES" votes required for a vote to pass.
set vote_percent "100"
//////////////////////////////Bitflag to modify voting options
set g_voting "0"
my fcvars.cfg
configname "Cvars restrictions"
init
{
command "sv_cvar com_maxfps IN 40 333"
command "sv_cvar r_flares IN 0 1"
command "sv_cvar cl_maxpackets IN 40 100"
command "sv_cvar cl_pitchspeed IN 0 140"
command "sv_cvar cl_yawspeed IN 0 140"
command "sv_cvar snaps IN 20 40"
command "sv_cvar cg_fov IN 50 125"
command "forcecvar rate 45000"
command "forcecvar r_primitives 2"
command "forcecvar r_ambientScale 0.5"
command "forcecvar r_colorMipLevels 0"
command "forcecvar r_drawentities 1"
command "forcecvar r_drawworld 1"
command "forcecvar r_lightmap 0"
command "forcecvar r_showmodelbounds 0"
command "forcecvar r_wolffog 1"
command "forcecvar r_zfar 0"
command "forcecvar r_showtris 0"
command "forcecvar r_znear 3"
command "forcecvar cl_freelook 1"
command "forcecvar cl_timenudge 0"
command "forcecvar cg_gun_frame 0"
}
Offline
Thank you verry much Jay.
Offline
I also have problems with the randommap lua. After the final map it crash the server. i have set the correct maplist.txt and maps.
Offline
Offline
Hi Jay,
---------------------------------
----- Random Next Map LUA -------
---------------------------------
-- Authors: Exagone313 and N!trox*
---- Exagone313:
-- Website: http://elou.world
-- Server: et.elou.world:27960
---- N!trox*:
-- Website: http://etmods.net
-- Server: etmods.net:27960
---------------------------------
-- Changelog:-- v0.5 -- March 23th 2015
-- Added: current map-- v0.4 -- March 10th 2015
-- Added: Automatic nextmap announce in the server chat
-- Added: Possibility to disable banners (see 'useBanners')-- v0.3 -- March 3rd 2015:
-- Added: messages templates
-- Added: Parse maplist from an external map list file, containing one map name per line
-- Added: Some code comments
-- Added: Register mod and mod version-- v0.2 -- March 2nd 2015
-- Fixed: Don't pick a different map during warmup and after a map_restart
-- Added: Next map can now automatically be displayed to players through banners-- v0.1 -- February 25th 2015
-- Fixed: Don't pick the current map or the last played map---- Initial release (v0.003):
-- Added support of randomseed for map randomization
-- Added a command to show the next map for both client and server
-- Get array size automatically with table.getn(maps)---------------------------------
--- MODULE CONFIGURATION ---
---------------------------------mapListFile = "/home/servera/nitmod/maplist.txt" -- Absolute path to the map list file
shownextcmd = "?next" -- Command that will be used to print the next map
chatInterval = 2 -- Delay, in minutes, between every automatic nextmap announce in the server chat
useBanners = 1 -- If set to 1, enable nextmap announce in server banners (i.e: 'bannerCvar' will be set to 'bannerMsg')
bannerCvar = "g_msg1" -- Define which banner will hold the "next map is ..." message
bannerMsg = "^dRandom-Map is running. Current map is ^2%s. ^dNext map is ^2%s." -- Banner message template (%s will be replaced by the name of the next map)
chatMsg = "^dRandom-Map is running. Current map is ^2%s. ^dNext map is ^2%s." -- Chat message template (%s will be replaced by the name of the next map)
CHATCMD = "chat" -- Chat command (use "b 8" to run this script on ETPro)---------------------------------
-- YOU DON'T NEED TO CHANGE ---
-- ANYTHING BELOW THIS LINE ---
---------------------------------MODNAME = "Random Map"
MODVERSION = "0.5"
maps = {} -- This array will contain the map list
nextmap = "none" -- This variable will contain the randomly selected next map
curmap = et.trap_Cvar_Get("mapname") -- Name of the current map
lastmap = et.trap_Cvar_Get("lastmap") -- Name of the last played map
msgSent = 0
msgTime = chatInterval * 60000 - 1
-- Parse the map list file into the "maps" array
function ParseMapFile()
local file = io.open(mapListFile, "r")
for line in file:lines() do
table.insert (maps, line);
end
endfunction msgSend(clientNum)
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. string.format(chatMsg, curmap, nextmap).. "\"")
endfunction et_InitGame(levelTime,randomSeed,restart)
local regModStr = string.format("%s v%s", MODNAME, MODVERSION)
et.RegisterModname(regModStr) -- Register the LUA module
ParseMapFile() -- Parse the map list now
et.trap_Cvar_Set(bannerCvar, "") -- Clear banner
et.trap_Cvar_Set("lastmap", curmap) -- Set "lastmap" to avoid map loops
luanm = et.trap_Cvar_Get("lua_nextmap") -- Get the previously selected random map
if( curmap == luanm or luanm == "" or (curmap ~= lastmap and curmap ~= luanm) ) then -- If we've moved to the selected nextmap, to another map, or if it has not yet been set, pick another random map
while (1) do
nextmap = maps[math.random(table.getn(maps))]
if ((nextmap ~= curmap) and (nextmap ~= lastmap)) then
break
end
end
else -- If we're didn't switch to the random map yet, or to another map, don't change it.
nextmap = luanm
end
et.trap_Cvar_Set("lua_nextmap", nextmap) -- Store the random map in a cvar to track it later
et.trap_Cvar_Set("nextmap", "map " .. nextmap) -- Set the nextmap vstr
if (useBanners == 1) then
et.trap_Cvar_Set(bannerCvar, string.format(bannerMsg, nextmap)) -- Set the banner
end
endfunction et_RunFrame( levelTime )
if( (chatInterval > 0) and ((msgSent + msgTime) < levelTime)) then
msgSent = levelTime
msgSend(-1)
end
endfunction et_ClientCommand(clientNum, command)
local arg0 = string.lower(et.trap_Argv(0))
local arg1 = string.lower(et.trap_Argv(1))
if ((arg0 == shownextcmd) or ((arg0 == "say") and (arg1 == shownextcmd)))then
msgSend(clientNum)
return 1
end
endfunction et_ConsoleCommand(command)
if (command == shownextcmd) then
et.G_Print("" .. string.format(chatMsg, curmap, nextmap) .. "\n")
return 1
end
end
Offline
Offline
Hi Jay, thats what ive used. But i am loading objectivecycle.cfg. Do i need to make other config? or it works with objectivecycle.cfg. And do i need to order the maps in maplist.txt.
Edit:
I have tested the script that you posted. Everything works fine but when i come back to first map like oasis. it loads oasis forever no nextmap thats different.
Last edited by Dennis92NL (22-Sep-16 10:32:41)
Offline
i run objective cycle gametype 2. but this should have no affect. how is your maplist.txt file looking?
Offline
Right now it looks like this:
battery
radar
oasis
goldrush
railgun
raw_final
Dennis
Last edited by Dennis92NL (22-Sep-16 12:10:08)
Offline
Offline
I got 10 maps running now. I will see what happens. Can i also put banners running on top and switching to chat. Now its only showing in chat.
Offline
I got 10 maps running now. I will see what happens. Can i also put banners running on top and switching to chat. Now its only showing in chat.
g_msgpos
0 : Chat
1 : Client console
2 : Top center of the screen
Default: 0
Offline
In the randommap.lua file i mean.
mapListFile = "/home/servera/nitmod/maplist.txt" -- Absolute path to the map list file
shownextcmd = "?next" -- Command that will be used to print the next map
chatInterval = 2 -- Delay, in minutes, between every automatic nextmap announce in the server chat
useBanners = 1 -- If set to 1, enable nextmap announce in server banners (i.e: 'bannerCvar' will be set to 'bannerMsg')
bannerCvar = "g_msg1" -- Define which banner will hold the "next map is ..." message
bannerMsg = "^dRandom-Map is running. Current map is ^2%s. ^dNext map is ^2%s." -- Banner message template (%s will be replaced by the name of the next map)
chatMsg = "^dRandom-Map is running. Current map is ^2%s. ^dNext map is ^2%s." -- Chat message template (%s will be replaced by the name of the next map)
CHATCMD = "chat" -- Chat command (use "b 8" to run this script on ETPro)
Offline
CHATCMD = "chat"
chat
Display a message to all users in the chat area
bp
Display a message to all users in the top of the screen
cp
Display a message to all users in the center of the screen
cpmsay
Display a message to all users in the popup message area of the screen
Last edited by jay1110 (22-Sep-16 20:33:51)
Offline
First of all i tired 10 maps and now its keep stuck on Oasis. Second when i type ?next in chat now it only shows up in the banners. Not in chat and offcourse it keeps repeating through rotation. And i need heavy weapons for bots dissabled they are OP.
Last edited by Dennis92NL (23-Sep-16 08:04:57)
Offline
look for omnibot/et/user/omnibot.cfg
[HeavyWeapons]
MinPlayersForMortar = 0
MinPlayersForMobileMG = 0
example config -> omnibot/et/user/omnibot.txt
also look here
omnibot/et/scripts/et_botnames_ext.gm
you can set weapon for each soldier
-------------------------------------------------------------------
with the random map problem i look on weekend.
Offline
I still have problems with the map cycle. At a certain point it plays the same map over and over. Anyone know how to fix this? I used all the correct files and scripts.
Picture:
Lua source:
---------------------------------
----- Random Next Map LUA -------
---------------------------------
-- Authors: Exagone313 and N!trox*
---- Exagone313:
-- Website: http://elou.world
-- Server: et.elou.world:27960 & et.clan-etc.de:27960
---- N!trox*:
-- Website: http://etmods.net
-- Server: etmods.net:27960
---------------------------------
-- Changelog:-- v0.8 -- April 10th 2016
-- Added: Set oasis if too much fails to load map-- v0.7 -- March 19th 2016
-- Added: command to show map list-- v0.6 -- September 27th 2015
-- Fixed: current map-- v0.5 -- March 23th 2015
-- Added: current map-- v0.4 -- March 10th 2015
-- Added: Automatic nextmap announce in the server chat
-- Added: Possibility to disable banners (see 'useBanners')-- v0.3 -- March 3rd 2015:
-- Added: messages templates
-- Added: Parse maplist from an external map list file, containing one map name per line
-- Added: Some code comments
-- Added: Register mod and mod version-- v0.2 -- March 2nd 2015
-- Fixed: Don't pick a different map during warmup and after a map_restart
-- Added: Next map can now automatically be displayed to players through banners-- v0.1 -- February 25th 2015
-- Fixed: Don't pick the current map or the last played map---- Initial release (v0.003):
-- Added support of randomseed for map randomization
-- Added a command to show the next map for both client and server
-- Get array size automatically with table.getn(maps)---------------------------------
--- MODULE CONFIGURATION ---
---------------------------------mapListFile = "/gs/et/srv307/nitmod/maplist.txt" -- Absolute path to the map list file
shownextcmd = "?next" -- Command that will be used to print the next map
showmapscmd = "?maps" -- Command that will be used to print the map list
mapListPreCmd = "Map list:" -- Message displayed before the map list
mapsPerLine = 6 -- Number of map to be displayed per line in the list
chatInterval = 1 -- Delay, in minutes, between every automatic nextmap announce in the server chat
useBanners = 1 -- If set to 1, enable nextmap announce in server banners (i.e: 'bannerCvar' will be set to 'bannerMsg')
bannerCvar = "g_msg1" -- Define which banner will hold the "next map is ..." message
bannerMsg = "^6MODE: RANDOM MAP. CURRENT MAP ^1%s^6. ^6NEXT MAP ^1%s^6." -- Banner message template (%s will be replaced by the name of the next map)
chatMsg = "^6MODE: RANDOM MAP. CURRENT MAP ^1%s^6. ^6NEXT MAP ^1%s^6." -- Chat message template (%s will be replaced by the name of the next map)
CHATCMD = "chat" -- Chat command (use "b 8" to run this script on ETPro)---------------------------------
-- YOU DON'T NEED TO CHANGE ---
-- ANYTHING BELOW THIS LINE ---
---------------------------------MODNAME = "Random Map"
MODVERSION = "0.6"
maps = {} -- This array will contain the map list
nextmap = "none" -- This variable will contain the randomly selected next map
curmap = et.trap_Cvar_Get("mapname") -- Name of the current map
lastmap_a = et.trap_Cvar_Get("lastmap_a") -- Name of the last played maps
lastmap_b = et.trap_Cvar_Get("lastmap_b")
lastmap_c = et.trap_Cvar_Get("lastmap_c")
lastmap_d = et.trap_Cvar_Get("lastmap_d")
msgSent = 0
msgTime = chatInterval * 60000 - 1
-- Parse the map list file into the "maps" array
function ParseMapFile()
local file = io.open(mapListFile, "r")
for line in file:lines() do
table.insert (maps, line);
end
endfunction nextMsgSend(clientNum)
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. string.format(chatMsg, curmap, nextmap).. "\"")
endfunction mapListMsgSend(clientNum)
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. mapListPreCmd .. "\"")
local color = 1
local n = 1
local line = ""
for id, map in ipairs(maps) do
if (n < mapsPerLine) then
line = line .. "^" .. color .. map .. " "
n = n + 1
else
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. line .. "^" .. color .. map .. "\"")
n = 1
line = ""
end
if(color < 9) then
color = color + 1
if(color == 4) then color = 5 end -- skip color 4 not goodly viewable
else
color = 1
end
end
endfunction et_InitGame(levelTime,randomSeed,restart)
local regModStr = string.format("%s v%s", MODNAME, MODVERSION)
et.RegisterModname(regModStr) -- Register the LUA module
ParseMapFile() -- Parse the map list now
et.trap_Cvar_Set(bannerCvar, "") -- Clear banner
et.trap_Cvar_Set("lastmap_d", et.trap_Cvar_Get("lastmap_c")) -- Set lastmap variables to avoid map loops
et.trap_Cvar_Set("lastmap_c", et.trap_Cvar_Get("lastmap_b"))
et.trap_Cvar_Set("lastmap_b", et.trap_Cvar_Get("lastmap_a"))
et.trap_Cvar_Set("lastmap_a", curmap)
luanm = et.trap_Cvar_Get("lua_nextmap") -- Get the previously selected random map
if( curmap == luanm or luanm == "" or (curmap ~= lastmap_a and curmap ~= luanm) ) then -- If we've moved to the selected nextmap, to another map, or if it has not yet been set, pick another random map
local i = 0
while (1) do
nextmap = maps[math.random(table.getn(maps))]
if ((nextmap ~= curmap) and (nextmap ~= lastmap_a and nextmap ~= lastmap_b and nextmap ~= lastmap_c and nextmap ~= lastmap_d)) then -- loop again if you get one of the last 4 maps
break
end
if (i > 10) then
nextmap = "oasis"
break
end
i = i + 1
end
else -- If we're didn't switch to the random map yet, or to another map, don't change it.
nextmap = luanm
end
et.trap_Cvar_Set("lua_nextmap", nextmap) -- Store the random map in a cvar to track it later
et.trap_Cvar_Set("nextmap", "map " .. nextmap) -- Set the nextmap vstr
if (useBanners == 1) then
et.trap_Cvar_Set(bannerCvar, string.format(bannerMsg, curmap, nextmap)) -- Set the banner
end
endfunction et_RunFrame( levelTime )
if( (chatInterval > 0) and ((msgSent + msgTime) < levelTime)) then
msgSent = levelTime
nextMsgSend(-1)
end
endfunction et_ClientCommand(clientNum, command)
local arg0 = string.lower(et.trap_Argv(0))
local arg1 = string.lower(et.trap_Argv(1))
if ((arg0 == shownextcmd) or ((arg0 == "say") and (arg1 == shownextcmd))) then
nextMsgSend(clientNum)
return 1
end
if ((arg0 == showmapscmd) or ((arg0 == "say") and (arg1 == showmapscmd))) then
mapListMsgSend(clientNum)
return 1
end
endfunction et_ConsoleCommand(command)
if (command == shownextcmd) then
et.G_Print("" .. string.format(chatMsg, curmap, nextmap) .. "\n")
return 1
end
end
Maplist:
oasis
battery
goldrush
radar
railgun
supply
pirates
northpole
braundorf_final
tc_base
et_ice
Frostbite
parisbastille_b3
transmitter
adlernest_2
snatch3
italyfp2
et_mor2_night_final
bremen_final
WodanfiresAssault_2
Offline
I dont know whats wrong. . write frostbite and wodanfireasssault_2 in small.
and maybe use my script.
thats working on my server with arround 80 or 90 maps.
---------------------------------
----- Random Next Map LUA -------
---------------------------------
-- Authors: Exagone313 and N!trox*
---- Exagone313:
-- Website: http://elou.world
-- Server: et.elou.world:27960
---- N!trox*:
-- Website: http://etmods.net
-- Server: etmods.net:27960
---------------------------------
-- Changelog:
-- v0.9 -- May 11th 2016
-- Added: Set next map on Console (can be added in a custom nitmod command)
-- Added: Force lower case map names
-- v0.8 -- April 10th 2016
-- Added: Set oasis if too much fails to load map
-- v0.7 -- March 19th 2016
-- Added: command to show map list
-- v0.6 -- September 27th 2015
-- Fixed: current map
-- v0.5 -- March 23th 2015
-- Added: current map
-- v0.4 -- March 10th 2015
-- Added: Automatic nextmap announce in the server chat
-- Added: Possibility to disable banners (see 'useBanners')
-- v0.3 -- March 3rd 2015:
-- Added: messages templates
-- Added: Parse maplist from an external map list file, containing one map name per line
-- Added: Some code comments
-- Added: Register mod and mod version
-- v0.2 -- March 2nd 2015
-- Fixed: Don't pick a different map during warmup and after a map_restart
-- Added: Next map can now automatically be displayed to players through banners
-- v0.1 -- February 25th 2015
-- Fixed: Don't pick the current map or the last played map
---- Initial release (v0.003):
-- Added support of randomseed for map randomization
-- Added a command to show the next map for both client and server
-- Get array size automatically with table.getn(maps)
---------------------------------
--- MODULE CONFIGURATION ---
---------------------------------
mapListFile = "/home/jay/etserv/servera/nitmod/maplist.txt" -- Absolute path to the map list file
shownextcmd = "?next" -- Command that will be used to print the next map
showmapscmd = "?maps" -- Command that will be used to print the map list
setnextmapclcmd = "setnextmap" -- Command used on the server console
mapListPreCmd = "Map list:" -- Message displayed before the map list
mapsPerLine = 6 -- Number of map to be displayed per line in the list
chatInterval = 2 -- Delay, in minutes, between every automatic nextmap announce in the server chat
useBanners = 1 -- If set to 1, enable nextmap announce in server banners (i.e: 'bannerCvar' will be set to 'bannerMsg')
bannerCvar = "g_msg1" -- Define which banner will hold the "next map is ..." message
bannerMsg = "^dMode: ^3Random Map^d. Current map ^2%s^d. ^dNext map ^2%s^d." -- Banner message template (%s will be replaced by the name of the next map)
chatMsg = "^dMode: ^3Random Map^d. Current map ^2%s^d. ^dNext map ^2%s^d." -- Chat message template (%s will be replaced by the name of the next map)
CHATCMD = "chat" -- Chat command (use "b 8" to run this script on ETPro)
---------------------------------
-- YOU DON'T NEED TO CHANGE ---
-- ANYTHING BELOW THIS LINE ---
---------------------------------
MODNAME = "Random Map"
MODVERSION = "0.9"
maps = {} -- This array will contain the map list
nextmap = "none" -- This variable will contain the randomly selected next map
curmap = et.trap_Cvar_Get("mapname") -- Name of the current map
lastmap_a = et.trap_Cvar_Get("lastmap_a") -- Name of the last played maps
lastmap_b = et.trap_Cvar_Get("lastmap_b")
lastmap_c = et.trap_Cvar_Get("lastmap_c")
lastmap_d = et.trap_Cvar_Get("lastmap_d")
msgSent = 0
msgTime = chatInterval * 60000 - 1
-- Parse the map list file into the "maps" array
function ParseMapFile()
local file = io.open(mapListFile, "r")
for line in file:lines() do
table.insert (maps, string.lower(line));
end
end
function nextMsgSend(clientNum)
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. string.format(chatMsg, curmap, nextmap).. "\"")
end
function mapListMsgSend(clientNum)
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. mapListPreCmd .. "\"")
local color = 1
local n = 1
local line = ""
for id, map in ipairs(maps) do
if (n < mapsPerLine) then
line = line .. "^" .. color .. map .. " "
n = n + 1
else
et.trap_SendServerCommand(clientNum, "" .. CHATCMD .. " \"" .. line .. "^" .. color .. map .. "\"")
n = 1
line = ""
end
if(color < 9) then
color = color + 1
if(color == 4) then color = 5 end -- skip color 4 not goodly viewable
else
color = 1
end
end
end
function setNextMap(mapName)
for id, map in ipairs(maps) do
if map == mapName then
nextmap = mapName
et.trap_Cvar_Set("nextmap", "map " .. nextmap)
nextMsgSend(-1)
et.G_Print("Next map set to " .. mapName .. "\n")
return
end
end
et.G_Print("Map " .. mapName .. " not found\n")
end
function et_InitGame(levelTime,randomSeed,restart)
local regModStr = string.format("%s v%s", MODNAME, MODVERSION)
et.RegisterModname(regModStr) -- Register the LUA module
ParseMapFile() -- Parse the map list now
et.trap_Cvar_Set(bannerCvar, "") -- Clear banner
et.trap_Cvar_Set("lastmap_d", et.trap_Cvar_Get("lastmap_c")) -- Set lastmap variables to avoid map loops
et.trap_Cvar_Set("lastmap_c", et.trap_Cvar_Get("lastmap_b"))
et.trap_Cvar_Set("lastmap_b", et.trap_Cvar_Get("lastmap_a"))
et.trap_Cvar_Set("lastmap_a", curmap)
luanm = et.trap_Cvar_Get("lua_nextmap") -- Get the previously selected random map
if( curmap == luanm or luanm == "" or (curmap ~= lastmap_a and curmap ~= luanm) ) then -- If we've moved to the selected nextmap, to another map, or if it has not yet been set, pick another random map
local i = 0
while (1) do
nextmap = maps[math.random(table.getn(maps))]
if ((nextmap ~= curmap) and (nextmap ~= lastmap_a and nextmap ~= lastmap_b and nextmap ~= lastmap_c and nextmap ~= lastmap_d)) then -- loop again if you get one of the last 4 maps
break
end
if (i > 10) then
nextmap = "oasis"
break
end
i = i + 1
end
else -- If we're didn't switch to the random map yet, or to another map, don't change it.
nextmap = luanm
end
et.trap_Cvar_Set("lua_nextmap", nextmap) -- Store the random map in a cvar to track it later
et.trap_Cvar_Set("nextmap", "map " .. nextmap) -- Set the nextmap vstr
if (useBanners == 1) then
et.trap_Cvar_Set(bannerCvar, string.format(bannerMsg, curmap, nextmap)) -- Set the banner
end
end
function et_RunFrame( levelTime )
if( (chatInterval > 0) and ((msgSent + msgTime) < levelTime)) then
msgSent = levelTime
nextMsgSend(-1)
end
end
function et_ClientCommand(clientNum, command)
local arg0 = string.lower(et.trap_Argv(0))
local arg1 = string.lower(et.trap_Argv(1))
if ((arg0 == shownextcmd) or ((arg0 == "say") and (arg1 == shownextcmd))) then
nextMsgSend(clientNum)
return 1
end
if ((arg0 == showmapscmd) or ((arg0 == "say") and (arg1 == showmapscmd))) then
mapListMsgSend(clientNum)
return 1
end
end
function et_ConsoleCommand(command)
if (command == shownextcmd) then
et.G_Print("" .. string.format(chatMsg, curmap, nextmap) .. "\n")
return 1
end
if (command == setnextmapclcmd) then
setNextMap(string.lower(et.trap_Argv(1)))
return 1
end
end
Last edited by jay1110 (30-Sep-16 22:10:05)
Offline
Hey Jay,
Thanks for your reply. I checked your lua source code with my one, your one counts more then 195 lines. My one only 170? Maby something is missing. Is there also a command for setting a nextmap rather then the ranom? like !setnext. I have !map already. Thanks for the exxcelent help.
Dennis
Offline
i told you here in post 7 to use this lua allready, thats the same as mine
for the setnext
add in commands.db
**********
name = setnextmap
exec = setnextmap [1]
desc = Set next map.
levels = 1, 2, 3
Offline
Hi,
i tired everything, your lua source, everyone else his... it's still loading the same map over and over. Il stick with objectivecycle.cfg tnhx for help it's not working.
Dennis
Offline
maybe exa have a solution for it. i think the script runs better with a high amount of maps. but normal when one map is over. it should come atleast after 4 maps.
Offline
Pages: 1