Forum

> > CS2D > Scripts > text:rank not work on (color script)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch text:rank not work on (color script)

34 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt text:rank not work on (color script)

DarkBooy
User Off Offline

Zitieren
Hello us , when i use this script :

Mehr >




And say : rank .... i not show my stats

can anyone give me solution For it . Or other text for show stats .

alt Re: text:rank not work on (color script)

DarkBooy
User Off Offline

Zitieren
@user BcY:


i try to add this ... but not Work

IF me(admin) say rank : i not get stats

Mehr >


i need other solution

alt Re: text:rank not work on (color script)

Rainoth
Moderator Off Offline

Zitieren
Is this the whole script ? I'm preety sure it doesn't work because you put it after all those ends so it's like.
Whole Thing works > You end it > then you make an "if". It won't work that way. Could you give whole script ? especially the "list_adm" part

alt Re: text:rank not work on (color script)

DarkBooy
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
list_adm = {89037}
addhook("say", "rankSay")
function rankSay(id, text)
			for _, i in ipairs(list_adm) do
			if (i == player(id, "usgn")) then
			local mtext = (player(id,"name").."©255255255 »Admin« ©255128000: ©000255000"..text)
			if player(id,"team")==1 then --T
			mtext=string.char(169).."255000000"..mtext
			elseif player(id,"team")==2 then --CT
			mtext=string.char(169).."050150255"..mtext
			elseif player(id,"team")==0 then --SPEC
			mtext=string.char(169).."255220000"..mtext
			end
			msg(mtext)
			return 1;
			end	
           	end 
                        end


> IF you have solution ... give me it

• Note : the edit i forgot put this : list_adm = {89037}

alt Re: text:rank not work on (color script)

Dynamite07
User Off Offline

Zitieren
i said you to try to add my code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("say", "rankSay")
function rankSay(id, text)
               for _, i in ipairs(list_adm) do
               if (i == player(id, "usgn")) then
       if (text =="rank") then
             parse(id,"say rank")
           return 1
          end
               local mtext = (player(id,"name").."©255255255 »Admin« ©255128000: ©000255000"..text)
               if player(id,"team")==1 then --T
               mtext=string.char(169).."255000000"..mtext
               elseif player(id,"team")==2 then --CT
               mtext=string.char(169).."050150255"..mtext
               elseif player(id,"team")==0 then --SPEC
               mtext=string.char(169).."255220000"..mtext
               end
               msg(mtext)
               return 1;
               end     
                end
end

alt Re: text:rank not work on (color script)

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
list_adm = {15476}
addhook("say", "rankSay")
function rankSay(id, text)
               for _, i in ipairs(list_adm) do
		 if string.lower(text) == "rank" then
         	 return 0
          	end
               if (i == player(id, "usgn")) then
               local mtext = (player(id,"name").."©255255255 »Admin« ©255128000: ©000255000"..text)
               if player(id,"team")==1 then --T
               mtext=string.char(169).."255000000"..mtext
               elseif player(id,"team")==2 then --CT
               mtext=string.char(169).."050150255"..mtext
               elseif player(id,"team")==0 then --SPEC
               mtext=string.char(169).."255220000"..mtext
               end
               msg(mtext)
               return 1;
               end     
                end 
                        end

Don't forget to change the adm_list back to your USGN

alt Re: text:rank not work on (color script)

EngiN33R
Moderator Off Offline

Zitieren
@user Dynamite07: That will never ever work.

Even though that works, I'd like to contribute a way I find prettier and more 'correct' - in this case, when there's only one exception.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("say", "rankSay")
function rankSay(id, text)
	for _, i in ipairs(list_adm) do
		if (i == player(id, "usgn")) then
			if (text~="rank") then
				local mtext = (player(id,"name").."©255255255 »Admin« ©255128000: ©000255000"..text)
				if player(id,"team")==1 then --T
					mtext=string.char(169).."255000000"..mtext
				elseif player(id,"team")==2 then --CT
					mtext=string.char(169).."050150255"..mtext
				elseif player(id,"team")==0 then --SPEC
					mtext=string.char(169).."255220000"..mtext
				end
				msg(mtext)
				return 1;
			end
		end     
	end
end

alt Re: text:rank not work on (color script)

DarkBooy
User Off Offline

Zitieren
Thanx all , but i have more problem

can help me ?

i need to :

1
2
3
4
5
6
7
8
9
10
11
playsound = {"rock star.ogg"};

addhook("say","snd")
function snd(id,txt)
for _, i in ipairs(list_adm) do
if(txt=="!rock star")then
parse("sv_sound ".. playsound[math.random(1,#playsound)]);
end
if (txt=="!the way") then parse("sv_sound \"fun/thats_the_way.wav\""); end
end
end


its work but i saw player say !rock star .. and it work ..

i need just work in admin ..

and i need this "!" just admin can use it in text

and no show in text

((maybe you no understand me))
1× editiert, zuletzt 23.02.13 15:29:48

alt Re: text:rank not work on (color script)

Rainoth
Moderator Off Offline

Zitieren
add
1
if player(id,"usgn") == 15476 then
after your 5th line and add one more "end" in the end.
EDIT : Though my way it's still going to show text I think. Don't you want to make a menu ? It would be much more simple than writing and other people wouldn't see when you use it.

alt Re: text:rank not work on (color script)

EngiN33R
Moderator Off Offline

Zitieren
user Rainoth hat geschrieben
add
1
if player(id,"usgn") == 15476 then


That would enable it only for one player.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
playsound = {"rock star.ogg"};

addhook("say","snd")
function snd(id,txt)
	for _, i in ipairs(list_adm) do
		if player(id,"usgn")==i then
			if(txt=="!rock star")then
				parse("sv_sound ".. playsound[math.random(1,#playsound)]);
				return 1;
			end
			if (txt=="!the way") then parse("sv_sound \"fun/thats_the_way.wav\""); return 1; end
		end
	end
end

Learn proper indentation, user DarkBooy.

alt Re: text:rank not work on (color script)

Rainoth
Moderator Off Offline

Zitieren
user EngiN33R hat geschrieben
user Rainoth hat geschrieben
add
1
if player(id,"usgn") == 15476 then


That would enable it only for one player.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
playsound = {"rock star.ogg"};

addhook("say","snd")
function snd(id,txt)
	for _, i in ipairs(list_adm) do
		if player(id,"usgn")==i then
			if(txt=="!rock star")then
				parse("sv_sound ".. playsound[math.random(1,#playsound)]);
				return 1;
			end
			if (txt=="!the way") then parse("sv_sound \"fun/thats_the_way.wav\""); return 1; end
		end
	end
end

Learn proper indentation, user DarkBooy.


That's true but can't you make "or player(id,"usgn") == xxxxx or player(id,"usgn") = xxxxy ?

alt Re: text:rank not work on (color script)

EngiN33R
Moderator Off Offline

Zitieren
user Rainoth hat geschrieben
That's true but can't you make "or player(id,"usgn") == xxxxx or player(id,"usgn") = xxxxy ?


You can, but then you'll have to add one such check for every administrator, and then place "or" between them all. What if there are 10 or more? It would just look crowded.

user DarkBooy hat geschrieben
can you make function for command "!" not show in text


1
2
3
if (text:sub(1,1)=="!") then
	return 1
end

alt Re: text:rank not work on (color script)

DarkBooy
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
addhook("say", "rankSay")
function rankSay(id, text)
     for _, i in ipairs(list_adm) do
          if (i == player(id, "usgn")) then
                 if (text:sub(1,1)=="!") then
                    return 1
                       end
               if (text~="rank") then
                    local mtext = (player(id,"name").."©255255255 »Admin« ©255128000: ©000255000"..text)
                    if player(id,"team")==1 then --T
                         mtext=string.char(169).."255000000"..mtext
                    elseif player(id,"team")==2 then --CT
                         mtext=string.char(169).."050150255"..mtext
                    elseif player(id,"team")==0 then --SPEC
                         mtext=string.char(169).."255220000"..mtext
                    end
                    msg(mtext)
                    return 1;
               end
          end     
     end
end





like this?

alt Re: text:rank not work on (color script)

EngiN33R
Moderator Off Offline

Zitieren
Yes, but your tabbing is a little screwed up.

Code >
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht