Forum

> > CS2D > Scripts > where it's wrong!!?...
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

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

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

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

Eternal
User Off Offline

Zitieren
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??

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

Apache uwu
User Off Offline

Zitieren
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?

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

Eternal
User Off Offline

Zitieren
user Apache uwu hat geschrieben
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

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

Apache uwu
User Off Offline

Zitieren
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".

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

Eternal
User Off Offline

Zitieren
user Apache uwu hat geschrieben
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

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

Apache uwu
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht