Forum

> > CS2D > Scripts > color ban,kick...fix
Forums overviewCS2D overview Scripts overviewLog in to reply

English color ban,kick...fix

8 replies
To the start Previous 1 Next To the start

old color ban,kick...fix

Mora
User Off Offline

Quote
hello us

someone can fix this?.here is no errors, but not work !kick ,!banusgn ,!banip .
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
owner = {114940}
mod = {x}
vip = {x}
newrank = {x}

addhook("say","s")
function s(id,message)
     for _,usgn in ipairs(owner) do
     if player(id,"usgn")==usgn then 
msg("©255255255 "..player(id,"name").." (owner) "..message)
	return 1
     end
     end
               if string.sub(message,1,6) == "!kick " then
                    parse("kick "..(string.sub(message,6,string.len(message))))
               elseif string.sub(message,1,9) == "!banusgn " then
                    parse("banusgn "..(string.sub(message,10,string.len(message))))
               elseif string.sub(s,1,7) == "!banip " then
                    parse("banip "..(string.sub(message,8,string.len(message))))
	return 0
               end
     for _,usgn in ipairs(mod) do
     if player(id,"usgn")==usgn then 
msg("©128128128 "..player(id,"name").." (mod) "..message)
	return 1
     end
     end
     for _,usgn in ipairs(vip) do
     if player(id,"usgn")==usgn then 
msg("©090255090 "..player(id,"name").." (vip) "..message)
	return 1
     end
     end
     for _,usgn in ipairs(newrank) do
     if player(id,"usgn")==usgn then 
msg("©000000000 "..player(id,"name").." (newrank) "..message)
	return 1
     end
     end
end
thanks

old Re: color ban,kick...fix

Yates
Reviewer 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
addhook("say","s")
function s(id,message)
	if string.sub(message,1,6) == "!kick " then
		parse("kick "..(string.sub(message,6,string.len(message))))
	elseif string.sub(message,1,9) == "!banusgn " then
		parse("banusgn "..(string.sub(message,10,string.len(message))))
	elseif string.sub(s,1,7) == "!banip " then
		parse("banip "..(string.sub(message,8,string.len(message))))
	end
	for _,usgn in ipairs(owner) do
		if player(id,"usgn")==usgn then 
			msg("©255255255 "..player(id,"name").." (owner) "..message)
			return 1
		end
	end
	for _,usgn in ipairs(mod) do
		if player(id,"usgn")==usgn then 
			msg("©128128128 "..player(id,"name").." (mod) "..message)
			return 1
		end
	end
	for _,usgn in ipairs(vip) do
		if player(id,"usgn")==usgn then 
			msg("©090255090 "..player(id,"name").." (vip) "..message)
			return 1
		end
	end
	for _,usgn in ipairs(newrank) do
		if player(id,"usgn")==usgn then 
			msg("©000000000 "..player(id,"name").." (newrank) "..message)
			return 1
		end
	end
end

old Re: color ban,kick...fix

Yates
Reviewer Off Offline

Quote
1
elseif string.sub(s,1,7) == "!banip " then

string.sub 1#, seriously.

Name of function: s
Trying to get sub of string: s
Error: Expected string, gets function.

1 + 1 = 2.

1
elseif string.sub(message,1,7) == "!banip " then
edited 1×, last 10.03.14 05:13:24 pm

old Re: color ban,kick...fix

G3tWr3ck3d
User Off Offline

Quote
At line 7:
1
elseif string.sub(s,1,7) == "!banip " then
replace this with:
1
elseif string.sub(message,1,7) == "!banip " then
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview