Spoiler
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
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
Adminlist = {20365} CoAdminlist = {43121} Modlist = {xxxxx} Memberlist = {28245,58746} -- String Split function string.split(text,b) local cmd = {} if b then b = b else b = "%s" end b = "[^"..b.."]+" for o in string.gmatch(text,b) do table.insert(cmd,o) end return cmd end function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end -- Init Array function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end -- Array function Array(size,value) local array = {} for i = 1, size do array[i]=value end return array end -- C Array function c_array(c,v) local t={} for i=1,c do t[i]=v end return t end ---Hooks--- addhook("join","coadmjoin") addhook("join","modjoin") addhook("join","memberjoin") addhook("join","userjoin") addhook("join","sayjoin") addhook("say","admsay") addhook("join","userjoin") ---End Hooks--- ---Value--- adminsay=initArray(32) coadminsay=initArray(32) modsay=initArray(32) membersay=initArray(32) userlevel=initArray(32) admincolor=initArray(32) coadmcolor=initArray(32) modcolor=initArray(32) membercolor=initArray(32) ---End Value--- function sayjoin(id) if userlevel[id]==1 then if adminsay[id]==0 then admincolor[id]="255000000" end end if userlevel[id]==2 then if coadminsay[id]==0 then coadmcolor[id]="000255000" end end if userlevel[id]==3 then if modsay[id]==0 then modcolor[id]="000000255" end end if userlevel[id]==4 then if membersay[id]==0 then membercolor[id]="255255255" end end end function admsay(id,txt)sayjoin(id) if userlevel[id]==1 then msg("©"..admincolor[id]..""..player(id,"name").." [Admin]: "..txt) return 1 elseif userlevel[id]==2 then msg("©"..coadmcolor[id]..""..player(id,"name").." [CoAdmin]: "..txt) return 1 end if userlevel[id]==3 then msg("©"..modcolor[id]..""..player(id,"name").." [Mod]: "..txt) return 1 end if userlevel[id]==4 then msg("©"..membercolor[id]..""..player(id,"name").." [Member]: "..txt) return 1 end end function userjoin(id) for _, usgn in ipairs(Adminlist) do if player(id,'usgn') == usgn then userlevel[id]=1 end end end function coadmjoin(id) for _, usgn in ipairs(CoAdminlist) do if player(id,'usgn') == usgn then userlevel[id]=2 end end end function modjoin(id) for _, usgn in ipairs(Modlist) do if player(id,'usgn') == usgn then userlevel[id]=3 end end end function memberjoin(id) for _, usgn in ipairs(Memberlist) do if player(id,'usgn') == usgn then userlevel[id]=4 end end end function usjoin(id) if (player(id,"usgn")>0) then local filename = "sys/lua/user_data/%s.txt" local file = io.open(filename:format(player(id,"usgn"), "r")) local line if not file then line = {0, 1} else line = file:read("*a"):split() end userlevel[id] = tonumber(line[1]) or 5 levelname[id] = tonumber(line[2]) or "User" else userlevel[id]=5 levelname[id]="User" end end