Forum

> > CS2D > Scripts > where it's wrong!!?...
Forums overviewCS2D overview Scripts overviewLog in to reply

English where it's wrong!!?...

6 replies
To the start Previous 1 Next To the start

old where it's wrong!!?...

Eternal
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","ranksay2")
function ranksay2(id,txt)
	if serverlvl[id] == 1 then
		msg("ฉ255255255"..player(id,"name").." [MOD] : "..txt)
	elseif serverlvl[id] == 2 then
		msg("ฉ255255255"..player(id,"name").." [SuperMod] : "..txt)
	elseif serverlvl[id] == 3 then
		msg("ฉ255255255"..player(id,"name").." [Admin] : "..txt)
	elseif serverlvl[id] == 4 then
		msg("ฉ255255255"..player(id,"name").." [Owner] : "..txt)
		return 1
	end
end

1
serverlvl=initArray(32)

it's double talk when i test it , where it's wrong??

old Re: where it's wrong!!?...

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","ranksay2")
function ranksay2(id,txt)
	if serverlvl[id] == 1 then
		msg(string.char(169).."255255255"..player(id,"name").." [MOD] : "..txt)
	elseif serverlvl[id] == 2 then
		msg(string.char(169).."255255255"..player(id,"name").." [SuperMod] : "..txt)
	elseif serverlvl[id] == 3 then
		msg(string.char(169).."255255255"..player(id,"name").." [Admin] : "..txt)
	elseif serverlvl[id] == 4 then
		msg(string.char(169).."255255255"..player(id,"name").." [Owner] : "..txt)
	end
	if serverlvl[id]>=0 and serverlvl[id]<=4 then
		return 1
	end
end

Like this?

old Re: where it's wrong!!?...

Eternal
User Off Offline

Quote
user Apache uwu has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","ranksay2")
function ranksay2(id,txt)
	if serverlvl[id] == 1 then
		msg(string.char(169).."255255255"..player(id,"name").." [MOD] : "..txt)
	elseif serverlvl[id] == 2 then
		msg(string.char(169).."255255255"..player(id,"name").." [SuperMod] : "..txt)
	elseif serverlvl[id] == 3 then
		msg(string.char(169).."255255255"..player(id,"name").." [Admin] : "..txt)
	elseif serverlvl[id] == 4 then
		msg(string.char(169).."255255255"..player(id,"name").." [Owner] : "..txt)
	end
	if serverlvl[id]>=0 and serverlvl[id]<=4 then
		return 1
	end
end

Like this?


Thank you , but still double talk

old Re: where it's wrong!!?...

Apache uwu
User Off Offline

Quote
Press ctrl-f and search for

1
addhook("say"

if you can find that anywhere in all the lua files that are attached by dofile or loaded somehow into the server--then you have a problem

Please paste the entire script or where you see instances of addhook("say".

old Re: where it's wrong!!?...

Eternal
User Off Offline

Quote
user Apache uwu has written
Press ctrl-f and search for

1
addhook("say"

if you can find that anywhere in all the lua files that are attached by dofile or loaded somehow into the server--then you have a problem

Please paste the entire script or where you see instances of addhook("say".


Oh fuck sorry , it has a say hook
sorry too muuch

1
2
3
4
5
6
7
addhook("say","ranksay")
function ranksay(id,txt)
	if vip[id] >= 1 then
		msg("ฉ255128000"..player(id,"name").." [VIP] : "..txt)
		return 1
	end
end

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","ranksay2")
function ranksay2(id,txt)
     if serverlvl[id] == 1 then
          msg(string.char(169).."255255255"..player(id,"name").." [MOD] : "..txt)
     elseif serverlvl[id] == 2 then
          msg(string.char(169).."255255255"..player(id,"name").." [SuperMod] : "..txt)
     elseif serverlvl[id] == 3 then
          msg(string.char(169).."255255255"..player(id,"name").." [Admin] : "..txt)
     elseif serverlvl[id] == 4 then
          msg(string.char(169).."255255255"..player(id,"name").." [Owner] : "..txt)
     end
     if serverlvl[id]>=0 and serverlvl[id]<=4 then
          return 1
     end
end

and your code is work well

but can you help me again

old Re: where it's wrong!!?...

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("say","ranksay2")
function ranksay2(id,txt)
	if vip[id] >= 1 then
		msg(string.char(169).."255128000"..player(id,"name").." [VIP] : "..txt)
		return 1
	end
	if serverlvl[id] == 1 then
		msg(string.char(169).."255255255"..player(id,"name").." [MOD] : "..txt)
	elseif serverlvl[id] == 2 then
		msg(string.char(169).."255255255"..player(id,"name").." [SuperMod] : "..txt)
	elseif serverlvl[id] == 3 then
		msg(string.char(169).."255255255"..player(id,"name").." [Admin] : "..txt)
	elseif serverlvl[id] == 4 then
		msg(string.char(169).."255255255"..player(id,"name").." [Owner] : "..txt)
	end
	if serverlvl[id]>=0 and serverlvl[id]<=4 then
		return 1
	end
end

Merged the 2 functions, now you can remove:

1
2
3
4
addhook("say","ranksay")
function ranksay(id,txt)
---
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview