Forum

> > CS2D > Scripts > God Mode menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English God Mode menu

4 replies
To the start Previous 1 Next To the start

old admin

NeptooN
User Off Offline

Quote
No, admin f2 - godmod
edited 1×, last 08.02.17 11:53:27 am

old Re: God Mode menu

Mami Tomoe
User Off Offline

Quote
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
53
54
55
56
57
58
59
60
61
function createArray(size,value) 
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end
gm_Admins = {155954} -- ENTER USGN HERE YOU CAN ADD MORE ADMINS WITH , (0,1,2,3...)
gm_mode = createArray(32,false)
gm_Admin = createArray(32,false)
addhook("hit","gm_hit")
addhook("menu","gm_menu")
addhook("join","gm_join")
addhook("leave","gm_leave")
addhook("serveraction","gm_serveraction")

function gm_hit(id,source)
	if gm_mode[id]==false then
		return 0
	end
	return 1
end

function gm_menu(id,title,button)
	if title == "Admin Menu" then
		if button == 1 then
			if gm_mode[id]==false then
				gm_mode[id]=true
				msg2(id,"\169128255128[SERVER]:\169255255128 God mode is now enabled.")
			else
				gm_mode[id]=false
				msg2(id,"\169128255128[SERVER]:\169255255128 God mode is now disabled.")
			end
		end
	end
end

function gm_serveraction(id,action)
	if action==1 then
		if gm_Admin[id]==true then
			menu(id,"Admin Menu,God Mode | "..tostring(gm_mode[id]))
		else
			msg2(id,"\169255128128[SERVER]:\169255255128 Access Denied.")
		end
	end
end

function gm_join(id)
	gm_mode[id]=false
	gm_Admin[id]=false
	for k,v in ipairs(gm_Admins) do
		if player(id,"usgn")==v then
			gm_Admin[id]=true
		end
	end
end

function gm_leave(id)
	gm_mode[id]=false
	gm_Admin[id]=false
end

I made this only for you and by the way saying please is welcomed.
This was tested and is based over a admin system so if you want to add admins find the line:
gm_Admins = {155954}

And just add another ID (I already set yours)

EDIT: Fixed a slight (rare) mistake.
edited 1×, last 08.02.17 07:23:29 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview