[Include] Msg (v1.0) - Chat lights colors and flexible formatting
#3

I don't get a part of the code, would you mind to explain it to me?

pawn Код:
static colors[2][9], cdata[1];
   
cdata[0] = color;
   
cdata{0} = floatround(float(cdata{0}) - (float(cdata{0}) * 0.3));
cdata{1} = floatround(float(cdata{1}) - (float(cdata{1}) * 0.3));
cdata{2} = floatround(float(cdata{2}) - (float(cdata{2}) * 0.3));
You create cdata array that can only get an index of 0 and so you did:
pawn Код:
cdata[0] = color;
but then you used { } and indexes 0, 1, 2 and that's the part I don't get. You didn't use any char in the array (for using { }) and neither the size of the cdata was 3 so you could have those 3 indexes, so my question is: What does it do?

EDIT: After few tests, it seems that those three give the R G B values of the color before assigning the new ones.
Reply


Messages In This Thread
Msg (v1.0) - Chat lights colors and flexible formatting - by RCON1 - 27.11.2013, 17:22
Re: Msg (v1.0) - Chat lights colors and flexible formatting - by PT - 27.11.2013, 18:26
Re: Msg (v1.0) - Chat lights colors and flexible formatting - by Konstantinos - 27.11.2013, 18:34
Re: Msg (v1.0) - Chat lights colors and flexible formatting - by RCON1 - 28.11.2013, 06:33
Re: Msg (v1.0) - Chat lights colors and flexible formatting - by feartonyb - 07.12.2013, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)