Forum

> > CS2D > Scripts > Random chat colors?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Random chat colors?

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Random chat colors?

strelok_953
User Off Offline

Zitieren
Hello us
I want make one script...but im n**b with msg2,msg,hudtxt etc.
Please.i need script like this:
1
2
3
4
5
6
7
8
9
rainbow = {33333}

addhook("say","talk")
function talk(id)
for _, in ipairs(rainbow) do
   if player(id,"usgn")=usgn then
msg(id," \rainbow «FunnyMan» <- here rainbow-i dont know how made it ")
end
end
please,help me with this.
Thanks you so much!
And sorry for my English.

Sorry me please! i mean Random (my English)
1× editiert, zuletzt 21.08.13 16:36:38

alt Re: Random chat colors?

strelok_953
User Off Offline

Zitieren
Like Avobolt in thread "Rainbow Welcome"
Avobolt hat geschrieben
addhook("join","welcome")
function welcome(id)
msg2(id,rainbowtext("Welcome!"))
end

but for ipairs and not txt ("Welcome!"))

roughly 0x45525A1,
so it don't fit me!
else i dont make this thread

alt Re: Random chat colors?

MikuAuahDark
User Off Offline

Zitieren
user MikuAuahDark hat geschrieben
there is a thread almost like this before and it showed on recent forum posts.


you can simply edit it:
1
2
3
4
5
6
7
8
9
10
11
rainbow = {33333}

addhook("say","talk")
function talk(id)
	for _, in ipairs(rainbow) do
		if player(id,"usgn")=usgn then
			msg(id,rainbowtext("«FunnyMan»").." whatever here")
			-- return 1 -- disable if necessary
		end
	end
end

alt Re: Random chat colors?

VADemon
User Off Offline

Zitieren
Here's the true rainbow chat:


But I'll probably never release that (or maybe later with a better in-game API) because of the limited characters (every char needs 10 chars to define a color > results in cut messages)
1× editiert, zuletzt 24.05.19 20:29:05

alt Re: Random chat colors?

TopNotch
User Off Offline

Zitieren
user strelok_953 hat geschrieben
Sorry! i mean Random
i think Rainbow is Random-my English =/

So you want a random color each time you send a message?
Spoiler >

alt Re: Random chat colors?

MikuAuahDark
User Off Offline

Zitieren
1
msg(string.format("\169%03d%03d%03d",math.random(0,255),math.random(0,255),math.random(0,255))..player(id,"name")..": "..txt)
Code above is better than user TopNotch cs2d lua cmd msg code. so you may need to replace it.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht