DarkBooy has written
Heloo,i need functions for GameMode:

can do change game mode

The game mode is : standard,dm,t dm,con,z

only for admin

and can use in my server and my script .
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
adminlist = {1,xxxxx} -- usgn of administrators
function isAdmin(id)
	for _, usgn in ipairs(adminlist) do
		if player(id,'usgn')== usgn then
			return true
		end
	end
	return false
end
addhook("serveraction","OnAction")
function OnAction(id,action)
if action == 1 then
if isAdmin(id) then
menu(id,"GameModes,Standard,Zombie,Deathmath,Construction,Team Deathmath")
end
end
end
addhook("menu","OnMenu")
function OnMenu(id,t,b)
if t == "GameModes" then
if b == 1 then
parse("sv_gm 0")
msg("©255255255Administrator "..player(id,'name').." Changed GameMode to Standard")
elseif b == 2 then
parse("sv_gm 4")
msg("©255255255Administrator "..player(id,'name').." Changed GameMode to Zombie")
elseif b == 3 then
parse("sv_gm 1")
msg("©255255255Administrator "..player(id,'name').." Changed GameMode to DeathMath")
elseif b == 4 then
parse("sv_gm 3")
msg("©255255255Administrator "..player(id,'name').." Changed GameMode to Construction")
elseif b == 5 then
parse("sv_gm 2")
msg("©255255255Administrator "..player(id,'name').." Changed GameMode to Team Deathmath")
end
end
end