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
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
owner = {140639} rank = {} ladm = {} for id = 1,32 do rank[id] = 0 end ladm.commands = { preffix = "!"; {"kick",level = 2,concat = 2,func = "kickCmd"}; {"ban",level = 3,concat = 2,func = "banCmd"}; } addhook("join","setrank") function setrank(id) for _, a in ipairs(owner) do if player(id,"usgn") == a then rank[id] = 5 end end end addhook("say","ladm.say") function ladm.say(id,txt) if string.sub(txt, 1, 1) == ladm.commands.preffix then 		local found = false 		local list = ladm.commands 		local txt = string.match(txt, "%p(.*)") 		local call = string.match(txt, "(.-)%s") or txt 		for key, command in ipairs(list) do 			local insert = table.insert 			local gmatch = string.gmatch 			local concat = table.concat 			found = false 			if #command > 1 then for _, name in ipairs(command) do if call == name then found = true end end 			elseif call == command[1] then found = true end 			if found == true then 				local params = {} 				local procCmd = false 				for word in gmatch(txt,"%S+") do if not procCmd and word == call then procCmd = true else insert(params, tonumber(word) or word) end end 				if command.concat then 					params[command.concat] = concat(params, " ", command.concat) 					for i = command.concat + 1, #params do params[i] = nil end 				end 				if command.params then 					insert(params, 1, command.params) 					params = concat(params, " ") 					parse(params) 					return 1 				end 				local func, err = pcall(loadstring(command.func.."(...)"), id, unpack(params)) 				if err then msg2(id,"Lua Error:"..err) ; print(err) end 				break 	 elseif key == #list then msg2(id,"Error,invalid command!") end 		end return 1 	end end function kickCmd(id,a,rs) if rank[id] > rank[a] then parse("kick "..a.." "..rs) msg(player(id,"name").." kicked "..player(a,"name").." for "..rs) elseif rank[id] <= rank[a] then msg2(id,"Cannot kick "..player(a,"name")) msg2(a,player(id,"name").." is trying to kick you!") end end function banCmd(id,t,rs) if rank[id] > rank[t] then parse("banusgn "..t.." 0 "..rs) parse("banip "..t.." 0 "..rs) msg(player(id,"name").." banned "..player(t,"name").." for "..rs) elseif rank[id] <= rank[t] then msg2(id,"Cannot ban "..player(t,"name")) msg2(t,player(id,"name").." is trying to ban you!") end end
1
sys/lua/main.lua:67: attempt to concatenate a boolean value
Its really weird that if i use the kick command then it gives an error and doesn't show the message but if its the ban command i use then it fully works . Anyone who can help me would be good , i've been trying to fix that problem alot of times but i just can't fix it by myself .