English How to create menu chat color

11 replies
Goto Page
To the start Previous 1 Next To the start
02.01.16 01:38:46 am
Up
MaxmyA_TN
BANNED
Offline Off
hi , i want ask ; how to make chat color in menu exmp:
when u press button color exp : red then u say color exp : ©25552552554m4axmya Tn "..txt)
DC Is so lazy for he add a new modifications >:/
02.01.16 02:22:30 am
Up
Zeik
User
Offline Off
What?!

I guess you mean something like this:
Yates - Shit menu colour say changer
02.01.16 04:09:14 am
Up
MaxmyA_TN
BANNED
Offline Off
@user Zeik: it sucks
DC Is so lazy for he add a new modifications >:/
02.01.16 04:25:16 am
Up
Sparty
Reviewer
Offline Off
how can it suck? whats the problem this time..
user DC has written:
@user omg: Actually a pretty good idea...
02.01.16 05:05:51 am
Up
Ace Howl
User
Offline Off
This one is simple. Consist of 9 colours, default colour on cancel button.
Global chat only >
02.01.16 11:40:21 am
Up
GeoB
Moderator
Offline Off
• Just a side note

The script made by user Ace Howl works without problems with the exception that it occupies all the serveraction buttons without letting space for other scripts which may use serveraction button. For that, here I've just tweaked it a bit from 12 to 14 line.
Code:
1
2
3
4
5
function txt.sa(id, action)
     if action == 1 then
          menu(id,"Chat Colour,White,Pink,Red,Orange,Green,Blue,Brown,Gray,Black")
     end
end

It's not a big deal but it's more advisable to keep only one reserved button for a simple script with only one menu. The rest can be used for other scripts.
02.01.16 02:59:26 pm
Up
Yates
Reviewer
Offline Off
user MaxmyA_TN has written:
@user Zeik: it sucks

Can you tell me why so I can fix the sucky part? Or are you just mad and would like to throw out pathetic insults? Both are fine by me, whatever makes your day I guess.
02.01.16 04:48:11 pm
Up
Ortimh
User
Offline Off
This code is untested. It may contains bugs. It should do pretty much the same as user Ace Howl's code.
Code:
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
maincolor = {
     "White=255255255",
     "Pink=255128255",
     "Red=255000000",
     "Orange=255128000",
     "Green=000255000",
     "Blue=000000255",
     "Brown=128064000",
     "Gray=128128128",
     "Black=000000000"
}
playercolor = {}

for id = 1, 32 do
     playercolor[id] = 0
end

for index, hook in ipairs({"serveraction", "menu", "say"}) do
     addhook(hook, hook .. "hook")
end

function serveractionhook(id, action)
     if (action == 1) then
          local contents = "Chat Color,"
          
          for index, value in ipairs(maincolor) do
               local name = value:match("(%s*)=(%d*)")
               
               contents = contents .. name .. (index < #maincolor and "," or "")
          end
          
          menu(id, contents)
     end
end

function menuhook(id, title, button)
     if (title == "Chat Color") then
          if (button >= 1 and button <= 9) then
               playercolor[id] = button
          end
     end
end

function sayhook(id, message)
     if (playercolor[id] > 0) then
          local name, color = maincolor[playercolor[id]]:match("(%s*)=(%d*)")
          
          msg(player(id, "name") .. ": "\169" .. color .. message)
     end
end
I'm awesome ... and I really like cookies.
02.01.16 07:13:24 pm
Up
Zeik
User
Offline Off
user MaxmyA_TN has written:
@user Zeik: it sucks

Wow!.. why you say it sucks? It's very well thought. You may not like it but you can't say it sucks...
02.01.16 08:14:27 pm
Up
Rainoth
Moderator
Offline Off
Allow me to elaborate.
While user Yates's file cs2d Yates - Shit menu colour/color say/chat changer (45) is indeed a very powerful tool. It does not have any predefined values and as such requires at least 8 brain cells and a couple of minutes to reach the desired effect.
I had similarly commented about his Y.A.T.E.S project - people are just too lazy/dumb to make stuff themselves so it's good to have pre-made things.
All these chat menu scripts do just that.
MAL • DeviantArt • For Wallpaper Engine users • Check YT for playlists... •
03.01.16 08:04:25 am
Up
Zeik
User
Offline Off
In that case... It wouldn't be bad to extend Yates' script functionality so it lets you save colors from its menu. That way you can change "predefined" colors directly in-game.
03.01.16 01:52:42 pm
Up
Yates
Reviewer
Offline Off
Yeah you could just assign the RGBV values which my script uses with a menu allowing you to still use the shit colour say changer whenever you want.
To the start Previous 1 Next To the start