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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
MORA_MOD = {}
--Players:
PLAYERS = {}
ALLOWED_TO_SEE_PLAYERS_WHO_IGNORE_YOU=true --it's allowed
--colours table
COLOUR = { -- colours. it's usage: "..COLOUR[1].." for example..i am using it for all my scripts :P
	"\169255220000", -- CS2D (yellow) 1
	"\169255255255", -- white 2
	"\169255000000", -- red 3
	"\169000255000", -- green 4
	"\169000000255", -- blue 5
	"\169200200200", -- light grey 6
	"\169064179162", -- PM - light blue 7
	"\169255025000", -- T 8
	"\169050150255", -- CT 9
	"\169100100100", -- pretty dark grey - tag 10
	"\169015200015", -- vip 11
	"\169155195255", -- trainee 12
	"\169050129255", -- mod 13
	"\169087000127", -- supporter 14
	"\169255106000", -- admin 15
	"\169255241234", -- owner 16
	"\169255195100", -- premium gold 17
	"\169200255020", -- nice green 18
	"\169090128255", -- nice blue 19 / water
	"\169255128090", -- nice red 20
	"\169255128000", -- orange 21
	"\169050255050", -- darkly green 22
	"\169149149044", -- molotovy 23
	"\169230020020", -- gutty 24
	"\169200255200", -- satchely 25
	"\169150255150", -- cute green 26
	"\169255174095", -- cute orange 27
	"\169216184162", -- blacksm 28
	"\169255174110", -- engineer 29
	"\169050150255", -- builder 30
	"\169087000127", -- mage 31
	"\169000000000", -- black 32
	"\169050050050", -- not so black 33
	"\169103153112", -- sick 34
	"\169186140140", -- hotdog 35
	"\169163133104", -- pizza 36
	"\169170140070", -- menadione 37
	"\169255185185", -- bandage 38 /pink
	"\169228213179", -- shawarma 39
	"\169172137084", -- box 40
	"\169116088069" -- wood box 41
}
addhook("team","MORA_MOD.team")
function MORA_MOD.team(id,team)
	if not (type(PLAYERS[id])=="table") then
		PLAYERS[id]={}
		PLAYERS[id].ID={}
	end
end
addhook("leave","MORA_MOD.leave")
function MORA_MOD.leave(id,reason)
	if (type(PLAYERS[id])=="table") then
		PLAYERS[id]=nil
	end
	local checkifhas=false
	local tablecount=0
	for _,p in pairs(player(0, "table")) do
		if (type(PLAYERS[p])=="table") then
			for k, v in pairs(PLAYERS[p].ID) do
				if v==id then
					checkifhas=true
					tablecount=k
					break
				end
			end
			if checkifhas then
				table.remove(PLAYERS[p].ID,tablecount)
				msg2(p,"[Info: player "..player(id,"name").." ("..id..") left server and your ignorelist.]")
			end
		end
	end
end
addhook("say","MORA_MOD.say")
function MORA_MOD.say(id,txt)
if txt=="rank" then return 0 end
	local pid=false
	if txt:sub(1,8)=="!ignore " then
	pid=true
		s = tonumber(txt:sub(9,10))
		if s then
			if player(s,"exists") then
				if s~=id then
				local checkif=false
					for k, v in pairs(PLAYERS[id].ID) do
						if v==s then
							checkif=true
							break
						end
					end
					if checkif then
						msg2(id,COLOUR[3].."[Error: this player is already in your ignore list.]")
					else
						msg2(id,COLOUR[4].."[Info: player "..COLOUR[27]..player(s,"name")..COLOUR[4].." ("..COLOUR[27]..s..COLOUR[4]..") successfuly added in your ignore list.]")
						table.insert(PLAYERS[id].ID,tonumber(s))
					end
				else
					msg2(id,COLOUR[3].."[Error: You cannot add yourself into ignorelist.]")
				end
			else
				msg2(id,COLOUR[3].."[Error: no player found with such id("..s..")]")
			end
		else
			msg2(id,COLOUR[3].."[Error: missing player id.]")
		end
	elseif txt:sub(1,10)=="!unignore " then
	pid=true
		s = tonumber(txt:sub(11,12))
		if s then
			if player(s,"exists") then
				if s~=id then
				local checkif=false
				local spid=0
					for k, v in pairs(PLAYERS[id].ID) do
						if v==s then
							spid=k
							checkif=true
							break
						end
					end
					if checkif then
						table.remove(PLAYERS[id].ID,spid)
						msg2(id,COLOUR[4].."[Info: player "..COLOUR[27]..player(s,"name")..COLOUR[4].." ("..COLOUR[27]..s..COLOUR[4]..") successfuly removed from your ignore list.]")
					else
						msg2(id,COLOUR[3].."[Error: this player is not in your ignore list.]")
					end
				else
					msg2(id,COLOUR[3].."[Error: it's not supposed you to be in your ignore list.]")
				end
			else
				msg2(id,COLOUR[3].."[Error: no player found with such id("..s..")]")
			end
		else
			msg2(id,COLOUR[3].."[Error: missing player id.]")
		end
	elseif txt:sub(1,10)=="!ignoreall" then
	pid=true
		if #player(0,"table")>1 then
			if #PLAYERS[id].ID<(#player(0,"table")-1) then
				PLAYERS[id].ID={}
				for p=1,#player(0,"table") do
					if p~=id then
						table.insert(PLAYERS[id].ID,player(0,"table")[p])
					end
				end
				msg2(id,COLOUR[4].."[info: successfuly added everyone in your ignore list.]")
			else
				msg2(id,COLOUR[3].."[Info: are you already ignore everybody.]")
			end
		else
			msg2(id,COLOUR[3].."[Error: server is empty. Nobody to ignore.]")
		end
	elseif txt:sub(1,12)=="!unignoreall" then
	pid=true
		if #PLAYERS[id].ID~=0 then
			PLAYERS[id].ID={}
			msg2(id,COLOUR[4].."[Info: successfuly cleaned ignore list.]")
		else
			msg2(id,COLOUR[3].."[Error: your ignore list is empty. Nobody to remove.]")
		end		
	elseif txt:sub(1,11)=="!ignorelist" then
	pid=true
		if #PLAYERS[id].ID~=0 then
			msg2(id,COLOUR[4].."[Info: ignore list]")
			for k, v in pairs(PLAYERS[id].ID) do
				msg2(id,COLOUR[4].."[Id: "..COLOUR[2].."#"..COLOUR[5]..v..COLOUR[4].." \ Name: "..COLOUR[27]..player(v,"name")..COLOUR[4].."]")
			end
		else
			msg2(id,COLOUR[3].."[Info: your ignore list is empty.]")
		end		
	elseif txt:sub(1,12)=="!whoignoreme" then
	pid=true
		if ALLOWED_TO_SEE_PLAYERS_WHO_IGNORE_YOU then
			pids={}
			for _,p in pairs(player(0, "table")) do
				if (type(PLAYERS[p])=="table") then
					for k, v in pairs(PLAYERS[p].ID) do
						if v==id then
							table.insert(pids,p)
							break
						end
					end
				end
			end
			if #pids~=0 then
				msg2(id,COLOUR[4].."[Info: players who ignore you.]")
				for i=1,#pids do
					msg2(id,COLOUR[4].."[Id: "..COLOUR[2].."#"..COLOUR[5]..pids[i]..COLOUR[4].." \ Name: "..COLOUR[27]..player(pids[i],"name")..COLOUR[4].."]")
				end
			else
				msg2(id,COLOUR[3].."[Info: nobody ignore you.]")
			end
		else
			msg2(id,COLOUR[3].."[Error: this command is turned OFF. You cant have such info.]")
		end
	end
	for p=1,#player(0,"table") do
		if p~=id then
			local send=false
			for i=1,#PLAYERS[player(0,"table")[p]].ID do
				if PLAYERS[player(0,"table")[p]].ID[i]==id then
					send=true
					break
				end
			end
			if not send then
				if not pid then
					msg2(player(0,"table")[p],COLOUR[4]..player(id,"name")..": "..COLOUR[1]..txt)
				end
			end
		end
	end
	if not pid then
		msg2(id,COLOUR[4]..player(id,"name")..": "..COLOUR[1]..txt)
	end
	return 1
end