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
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
addhook("join","infojoin") function infojoin(id) for none, usgn in ipairs(OWNER) do if player(id,'usgn') == usgn then msg2(id,"©000255000Welcome,you are the server owner") msg2(id,"©000255000!cmds for list of available commands!") Rank[id] = 5 end for none, usgn in ipairs(ADMIN) do if player(id,'usgn') == usgn then msg2(id,"©000255000Welcome,you are the server Admin") msg2(id,"©000255000!cmds for list of available commands!") Rank[id] = 4 end for none, usgn in ipairs(MOD) do if player(id,'usgn') == usgn then msg2(id,"©000255000Welcome,you are the server Moderator") msg2(id,"©000255000!cmds for list of available commands!") Rank[id] = 3 end for none, usgn in ipairs(MEMBER) do if player(id,'usgn') == usgn then msg2(id,"©000255000Welcome,you are the server Member") msg2(id,"©000255000!cmds for list of available commands!") Rank[id] = 2 end for none, usgn in ipairs(VIP) do if player(id,'usgn') == usgn then msg2(id,"©000255000Welcome,you are a VIP") msg2(id,"©000255000!cmds for list of available commands!") Rank[id] = 1 end end end end end end end addhook("leave","hasleft") function hasleft(id,reason) if reason == 0 or reason == 1 then Rank[id] = 0 end end
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
addhook("say","saycmds") function saycmds(id,txt) -- Kick if txt:sub(1,5) == "!kick" and Rank[id] >= 2 then local kickid = txt:sub(7,8) local kreason = txt:sub(10,#txt) if Rank[id] > Rank[kickid] then parse("kick "..kickid.." "..kreason) if Rank[id] < Rank[kickid] then msg2(id,"©255000000Error:Can't kick because that player has higher rank") -- Ban(USGN and IP) elseif txt:sub(1,4) == "!ban" and Rank >= 3 then local banid = txt:sub(6,7) local banreason = txt:sub(9,#txt) if Rank[id] > Rank[banid] then parse("banusgn "..player(banid,'usgn').." 0 "..banreason) parse("banip "..player(banid,'ip').." 0 "..banreason) if Rank[id] < Rank[banid] then msg2(id,"©255000000Error:Can't ban because that player has higher rank") end end end end end end
but when i try to test it i receive this error: attempt to compare nil with number,so why do i receive this error? help please.