If you want to use random colors, simply replace the first 3 arguments in "set_hudmessage" with "random(256)".
If you want to use a predefined set of colors of your choioce, then things will get a little more complicated. You will need to create a 3-dimensional array that holds each set of colors, and then iterate that array and use its elements as arguments in "set_hudmessage".
Example of how the array should be created:
Code:
static const HUD_COLORS[][] =
{
{ 255, 0, 0 },
{ 0, 255, 0 },
{ 0, 0, 255 },
{ 255, 255, 255 }
}
* Note: I used "static" because I defined it as a local array. If you need to use it in more than one place, define it as a global variable using "new".
Add/remove as many colors as you want.
Then you will need a variable (global new or local static) that holds the current iteration, starting from 0, up to the size of the array.
Code:
static CURRENT_COLOR
Then, use the "set_hudmessage" function with the current color set:
Code:
set_hudmessage(HUD_COLORS[CURRENT_COLOR][0], HUD_COLORS[CURRENT_COLOR][1], HUD_COLORS[CURRENT_COLOR][2], /* all other arguments stay the same */)
Display the message and all other stuff related to it.
Next, add +1 to the "CURRENT_COLOR" variable. If it reached the end of the array, reset it back to 0.
Code:
if(++CURRENT_COLOR == sizeof(HUD_COLORS))
{
CURRENT_COLOR = 0
}
__________________