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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
adminlist={24568}	-- Add admin usgn here, separated with comma
state={}
teambalancestate={"OFF","ON"}
function checkadmin(id)
	for num, val in ipairs(adminlist) do
		if player(id,"usgn")==val then
			state[id].admin=true
		end
	end
end
function mejikuhibiniu()
	if teambalancestate[1]=="ON" then
		parse("mp_teambalance 1")
	else
		parse("mp_teambalance 0")
	end
	if teambalancestate[2]=="OFF" then
		parse("mp_teambalance 0")
	else
		parse("mp_teambalance 1")
	end
end
mejikuhibiniu()
addhook("join","idlejoin")
function idlejoin(id)
	checkadmin(id)
end
addhook("serveraction","idleserver")
function idleserver(id,fx)
	if fx==2 then
		menu(id,"Admin menu,Enable team balance|"..teambalancestate[1]..",Disable team balance|"..teambalancestate[2]..")
	end
end
addhook("menu","idlemenu")
function idlemenu(id,menu,select)
	if menu=="Admin menu" then
		if sel==1 then
			teambalancestate[1]="ON"
			teambalancestate[2]="OFF"
		elseif sel==2 then
			teambalancestate[1]="OFF"
			teambalancestate[2]="ON"
		end
		mejikuhibiniu()
		menu(id,"Admin menu,Enable team balance|"..teambalancestate[1]..",Disable team balance|"..teambalancestate[2]..")
	end
end