Help | Message Colors
#1

ok, i want to do a random color like everytime it will be a random color..
like:

PHP код:
SendClientMessageToAll(COLOR_WHITE,"Type /Ventrilo and check out our Ventrilo IP - {%s}NEW"RandomC); 
the RandomC will be a random color but not regular colors like 0xFF0000FF
I mean colors like {FF0000} {FFFFFF} colors like that and i tried to do it something like 2 hours, with no success
please help !!
Reply
#2

pawn Код:
#define MAX_PLAYER_COLORS 50

new PlayerColors[MAX_PLAYER_COLORS] = {
    FF8C13,C715FF,20B2AA,DC143C,6495ED,f0e68c,778899,FF1493,F4A460,
    EE82EE,FFD720,8b4513,4949A0,148b8b,14ff7f,556b2f,0FD9FA,10DC29,
    534081,0495CD,EF6CE8,BD34DA,247C1B,0C8E5D,635B03,CB7ED3,65ADEB,
    5C1ACC,F2F853,11F891,7B39AA,53EB10,54137D,275222,F09F5B,3D0A4F,
    22F767,D63034,9A6980,DFB935,3793FA,90239D,E9AB2F,AF2FF3,057F94,
    B98519,388EEA,028151,A55043,0DE018
};
On the top of ur script

pawn Код:
new rand = random(MAX_PLAYER_COLORS);
new string[128];
format(string,128,"Type /Ventrilo and check out our Ventrilo IP - {%s}NEW", PlayerColors[rand]);
SendClientMessageToAll(COLOR_WHITE,string);
Where you wanna send the message

Ofcourse, you can add more colors, but be sure to edit the MAX_PLAYER_COLORS.
Reply
#3

errors:

PHP код:
C:\Users\User\Desktop\Universal Mode\Multi.pwn(1107) : error 017undefined symbol "FF8C13"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(1113) : error 010invalid function or declaration 
Reply
#4

Did you put the colors part at the top of your script?
Reply
#5

Yes ... Not working
Reply
#6

PlayerColors[MAX_PLAYER_COLORS]

replace with

PlayerColors[]
Reply
#7

Again:

PHP код:
C:\Users\User\Desktop\Universal Mode\Multi.pwn(1107) : error 017undefined symbol "FF8C13"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(1113) : error 010invalid function or declaration 
Reply
#8

I think you have to add quotes around each hex code.

Start off with "FF8C13","C715FF","20B2AA", etc for the rest.
Reply
#9

no errors but not working...
its write in the chat something like "********************* {5FF} *****************"
and just 5FF not the complete code..
Reply
#10

Quote:
Originally Posted by arad55
Посмотреть сообщение
no errors but not working...
its write in the chat something like "********************* {5FF} *****************"
and just 5FF not the complete code..
A RBG code is made out of 6 characters. RRBBGG
So for a RBG code to work and to be embeded correctly it must be 6 characters long.

{FF0000} - Red.
{00FF00} - Blue.
{0000FF} - Green.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)