select Load map X and in X: write the map name plus the loadmaps.howload string (:loadteams default). you can change it, its in line 2 just change the thing inside the " ".
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
loadmaps = {} -- a random name xD
loadmaps.howload = ":loadteams" -- How call this function in the entity gameaction
--in "X:" write the map name plus this at end as <MAPNAME>+<THE KEYWORD>. example:
--de_dust2:loadteams
loadmaps.howload = loadmaps.howload:lower()
addhook("triggerentity","loadmaps.triggerhook")
function loadmaps.triggerhook(x,y)
	if entity(x,y,"typename") == "Func_GameAction" then
		--this entity is func_gameaction
		if entity(x,y,"int0") == 7 then
			--the action is load map
			if entity(x,y,"str0"):lower():find(loadmaps.howload.."$") then
				--the entity called this lol
				local map = entity(x,y,"str0"):gsub(loadmaps.howload,"")
				loadmaps.playerteams = {}
				for _,id in ipairs(player(0,"table")) do
					loadmaps.playerteams[id] = player(id,"team")
				end
				parse("map "..map)
				return 1
			end
		end
	end
end
function loadmaps.newmap()
	if loadmaps.playerteams then
		for id,team in ipairs(loadmaps.playerteams) do
			if player(id,"exists") and team~=0 then
				parse("make"..(team==1 and "t" or "ct").." "..id)
			end
		end
		loadmaps.playerteams = nil
	end
end
loadmaps.newmap()
loadmaps.newmap = nil
Wtv, this probably will not work propertly cuz of the people will not join instantly after map change.