AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how do i add colors to adminchat (https://forums.alliedmods.net/showthread.php?t=108487)

wahmeng 11-05-2009 20:42

how do i add colors to adminchat
 
how can i add colors like pink purple black etc to the @ | @@ | @@@ chats?? someone help thnx loads and loads

drumzplaya13 11-05-2009 20:47

Re: how do i add colors to adminchat
 
@b text
@g text
@p text
@bl? text

Etc. OR

@@g text
@@b text

etc.

experiment with the rest of the letters.

ConnorMcLeod 11-05-2009 20:49

Re: how do i add colors to adminchat
 
It seems that alreay 2 colors (last ones) are not used in adminchat plugin.

PHP Code:

new g_Colors[MAX_CLR][] = {"COL_WHITE""COL_RED""COL_GREEN""COL_BLUE""COL_YELLOW""COL_MAGENTA""COL_CYAN""COL_ORANGE""COL_OCEAN""COL_MAROON"}
new 
g_Values[MAX_CLR][] = {{255255255}, {25500}, {02550}, {00255}, {2552550}, {2550255}, {0255255}, {227968}, {4589116}, {1034438}} 

PHP Code:

    switch (said[i])
    {
        case 
'r'1
        
case 'g'2
        
case 'b'3
        
case 'y'4
        
case 'm'5
        
case 'c'6
        
case 'o'7
    


You could replace some of the 8 first colors with you color values (replace only RGB values, not colors names.

wahmeng 11-05-2009 22:07

Re: how do i add colors to adminchat
 
Quote:

Originally Posted by ConnorMcLeod (Post 982034)
It seems that alreay 2 colors (last ones) are not used in adminchat plugin.

PHP Code:

new g_Colors[MAX_CLR][] = {"COL_WHITE""COL_RED""COL_GREEN""COL_BLUE""COL_YELLOW""COL_MAGENTA""COL_CYAN""COL_ORANGE""COL_OCEAN""COL_MAROON"}
new 
g_Values[MAX_CLR][] = {{255255255}, {25500}, {02550}, {00255}, {2552550}, {2550255}, {0255255}, {227968}, {4589116}, {1034438}} 

PHP Code:

    switch (said[i])
    {
        case 
'r'1
        
case 'g'2
        
case 'b'3
        
case 'y'4
        
case 'm'5
        
case 'c'6
        
case 'o'7
    


You could replace some of the 8 first colors with you color values (replace only RGB values, not colors names.

does this mean i can only replace the colors ??? :(

fysiks 11-05-2009 22:58

Re: how do i add colors to adminchat
 
Quote:

Originally Posted by wahmeng (Post 982087)
does this mean i can only replace the colors ??? :(

It's possible to add colors I believe but you should be diligent when you do it.

drumzplaya13 11-06-2009 13:55

Re: how do i add colors to adminchat
 
Quote:

Originally Posted by wahmeng (Post 982087)
does this mean i can only replace the colors ??? :(

Make a new case and pick a letter which isnt already in use. Find out what color you want. For example if you wanted to add purple.


PHP Code:

 switch (said[i])
    {
        case 
'r'1
        
case 'g'2
        
case 'b'3
        
case 'y'4
        
case 'm'5
        
case 'c'6
        
case 'o'7
        
case 'p'8
    


Then you need to have the color added to g_Colors so COL_PURPLE

PHP Code:

new g_Colors[MAX_CLR][] = {"COL_WHITE""COL_RED""COL_GREEN""COL_BLUE""COL_YELLOW""COL_MAGENTA""COL_CYAN""COL_ORANGE""COL_OCEAN""COL_MAROON" "COL_PURPLE"

Then you need to find the Red, Green, Blue. or RGB of the color, you can do this by going into paint and looked at advanced colors. 174, 50, 205 (it is a shade of purple pick what you want)
PHP Code:

new g_Values[MAX_CLR][] = {{255255255}, {25500}, {02550}, {00255}, {2552550}, {2550255}, {0255255}, {227968}, {4589116}, {1034438} {17450205}} 

and then you have purple. I think. Ha. Never done it before but from what the example was. That is how you change colors.

ConnorMcLeod 11-06-2009 15:44

Re: how do i add colors to adminchat
 
case 'p': a = 10

Fixed.

Also, you need to add the COL_PURPLE key into the ML file.

drumzplaya13 11-06-2009 22:47

Re: how do i add colors to adminchat
 
Curious why it is case 'p': a = 10 and not 8. I was going down the line to the next number. Also, Forgot about the ML file, even though I am not trying to change the colors that is really good to know for the future. thanks :D

ConnorMcLeod 11-07-2009 05:51

Re: how do i add colors to adminchat
 
Because colors 8 and 9 are not used in the code.

fysiks 11-07-2009 14:40

Re: how do i add colors to adminchat
 
You'll get index out of bounds unless you pad your arrays.


All times are GMT -4. The time now is 17:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.