Forum

> > CS2D > Scripts > The color of the chat for all players, open menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English The color of the chat for all players, open menu

9 replies
To the start Previous 1 Next To the start

old Re: The color of the chat for all players, open menu

Scott
BANNED 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
chat = {}
txt = {}

for id = 1,32 do
     chat[id] = {mode = 0}
end

addhook("menu","colorsmenu")
addhook("say","colorsmsg")
addhook ("serveraction","menu_colors")

function menu_colors(id,action)
if action==1 then
menu(id,"Admin Chat Color,White,Pink,Red,Orange,Green,Blue,Brown,Gray,Remove Colors|X")
end
end

function colorsmenu(id,tit,btn)
     if tit=="Admin Chat Color" then
          if btn == 1 then
               chat[id].mode = 1
               msg2(id,"\169255255255Chat colour has been changed to White.@C")
          elseif btn == 2 then
               chat[id].mode = 2
               msg2(id,"\169255128255Chat colour has been changed to Pink.@C")
          elseif btn == 3 then
               chat[id].mode = 3
               msg2(id,"\169255000000Chat colour has been changed to Red.@C")
          elseif btn == 4 then
               chat[id].mode = 4
               msg2(id,"\169255128000Chat colour has been changed to Orange.@C")
          elseif btn == 5 then
               chat[id].mode = 5
               msg2(id,"\169000255000Chat colour has been changed to Green.@C")
          elseif btn == 6 then
               chat[id].mode = 6
               msg2(id,"\169000000255Chat colour has been changed to Blue.@C")
          elseif btn == 7 then
               chat[id].mode = 7
               msg2(id,"\169128064000Chat colour has been changed to Brown.@C")
          elseif btn == 8 then
               chat[id].mode = 8
               msg2(id,"\169128128128Chat colour has been changed to Gray.@C")
          elseif btn == 9 then
               chat[id].mode = 0
               msg2(id,"Chat colour has been changed to default.@C")
          end
     end
end

function colorsmsg(id,txt)
      msg(teamclr(id)..""..player(id,"name")..": "..returnmsg(id)..""..txt)
     return 1
end

function returnmsg(id)
     if chat[id].mode == 0 then
          return "\169255255000"
     elseif chat[id].mode == 1 then
          return "\169255255255"
     elseif chat[id].mode == 2 then
          return "\169255128255"
     elseif chat[id].mode == 3 then
          return "\169255000000"
     elseif chat[id].mode == 4 then
          return "\169255128000"
     elseif chat[id].mode == 5 then
          return "\169000255000"
     elseif chat[id].mode == 6 then
          return "\169000000255"
     elseif chat[id].mode == 7 then
          return "\169128064000"
     elseif chat[id].mode == 8 then
          return "\169128128128"
     elseif chat[id].mode == 9 then
          return "\169255255000"
     end
end

function teamclr(id)
     if player(id,"team") == 1 then
          return "\169255025000"
     elseif player(id,"team") == 2 then
          return "\169050150255"
     end
end

old Re: The color of the chat for all players, open menu

Rainoth
Moderator Off Offline

Quote
Quote
simply he need F2 menu with colors

> Literally what his script is

@user Yates: Unless he means that he wants pre-defined rainbow colors. In which case you could improve your script to have a bunch of colored squares which you can click to set to the color you want instead of using the sliders. Just an idea to improve it.

old Re: The color of the chat for all players, open menu

NeptooN
User Off Offline

Quote
@user Scott: thank you
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
chat = {}
txt = {}

for id = 1,32 do
     chat[id] = {mode = 0}
end

addhook("menu","colorsmenu")
addhook("say","colorsmsg")
addhook ("serveraction","menu_colors")

function menu_colors(id,action)
if action==1 then
menu(id,"Menu color,Chat colors")
end
end

adhook("menu","Menu_fes")
function Menu_fes(id,title,buton")
if title=="Menu colors" then
if buton==1 then
menu(id,"White,Pink,Red,Orange,Green,Blue,Brown,Gray,Remove Colors|X") 
end
end
end

function colorsmenu(id,tit,btn)
     if tit=="Chat Colors" then
          if btn == 1 then
               chat[id].mode = 1
               msg2(id,"\169255255255Chat colour has been changed to White.@C")
          elseif btn == 2 then
               chat[id].mode = 2
               msg2(id,"\169255128255Chat colour has been changed to Pink.@C")
          elseif btn == 3 then
               chat[id].mode = 3
               msg2(id,"\169255000000Chat colour has been changed to Red.@C")
          elseif btn == 4 then
               chat[id].mode = 4
               msg2(id,"\169255128000Chat colour has been changed to Orange.@C")
          elseif btn == 5 then
               chat[id].mode = 5
               msg2(id,"\169000255000Chat colour has been changed to Green.@C")
          elseif btn == 6 then
               chat[id].mode = 6
               msg2(id,"\169000000255Chat colour has been changed to Blue.@C")
          elseif btn == 7 then
               chat[id].mode = 7
               msg2(id,"\169128064000Chat colour has been changed to Brown.@C")
          elseif btn == 8 then
               chat[id].mode = 8
               msg2(id,"\169128128128Chat colour has been changed to Gray.@C")
          elseif btn == 9 then
               chat[id].mode = 0
               msg2(id,"Chat colour has been changed to default.@C")
          end
     end
end

function colorsmsg(id,txt)
      msg(teamclr(id)..""..player(id,"name")..": "..returnmsg(id)..""..txt)
     return 1
end

function returnmsg(id)
     if chat[id].mode == 0 then
          return "\169255255000"
     elseif chat[id].mode == 1 then
          return "\169255255255"
     elseif chat[id].mode == 2 then
          return "\169255128255"
     elseif chat[id].mode == 3 then
          return "\169255000000"
     elseif chat[id].mode == 4 then
          return "\169255128000"
     elseif chat[id].mode == 5 then
          return "\169000255000"
     elseif chat[id].mode == 6 then
          return "\169000000255"
     elseif chat[id].mode == 7 then
          return "\169128064000"
     elseif chat[id].mode == 8 then
          return "\169128128128"
     elseif chat[id].mode == 9 then
          return "\169255255000"
     end
end

function teamclr(id)
     if player(id,"team") == 1 then
          return "\169255025000"
     elseif player(id,"team") == 2 then
          return "\169050150255"
     end
end
yes? script
edited 2×, last 23.02.17 02:24:57 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview