LUA : know intermission map voted for ?


(ETdemin) #1

Hello :cool:

is it possible to know the name of the voted winning map at intermission with LUA ?

thanks to all


(twt_thunder) #2

this could actually be a cool feature


(ailmanki) #3

isn’t the server loading that map, as soon as it has won?


(twt_thunder) #4

think he only wants it to show in intermission


(Micha) #5

Hm you can detect if the map is passed. I tried to make a mapfix so it always lowers the letters.


function et_Print(text)
	if text == "mapvoteinfo: wrote" then --map fix
		local nextmap = string.lower(et.trap_Cvar_Get( "nextmap" )) --lower mapname on intermission map vote
		et.trap_Cvar_Set( "nextmap", nextmap )
	end
end

You could try this and do something with getmapname (I think announce wont work because server is already in init).


function et_Print(text)
	if text == "mapvoteinfo: wrote" then --map fix
		getmapname = string.lower(et.trap_Cvar_Get( "nextmap" )) --output lower mapname: 'getmapname'
	end
end

I think this is a part out of the source you are looking for:


		if ( highMapVote > 0 ) {
			trap_SendConsoleCommand( EXEC_APPEND,
					va("map %s;set nextmap %s
",
						level.mapvoteinfo[nextMap].bspName,
						g_nextmap.string));
		} else {
			trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap
" );
		}
	} else {
		trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap
" );