09.11.2009, 21:13
Quote:
Originally Posted by LienK
I have defined 100 colors like this:
#define COLOR_1 0xAAAAAAFF #define COLOR_2 0xAAAAAAFF ... #define COLOR_100 0xAAAAAAFF And I want the player to be able to write /color [number] and then get the color that the number is associated with in the #defines. Of course I could use: if(number == 1) { SetPlayerColor(playerid, COLOR_1); } if(number == 2 { SetPlayerColor(playerid, COLOR_2); } Etc. But is there a simpler way to do this? Like taking the number the player inputs and set it at the end of COLOR_, or something? |
But I believe this is possible:
pawn Код:
new color[] =
{
0xFFFFFF,
0xFFFF00,
0xFF00FF,
0x00FFFF,
0x0000FF,
0x00FF00
};
// @ /color [number]
SetPlayerColor(playerid, color[number]);