10.03.2012, 06:12
(
Последний раз редактировалось SsHady; 10.03.2012 в 06:49.
)
Fixed Thnx To Faisal_Khan and Shabi_Roxx
new randomColor[10] = {Color1, color2, color3, color4....};
SetPlayerColor(playerid, randomColor[random(sizeof(randomColor))]);
//creating new array
new Colors[] =
{
0x0BE3F4FF, // Color1
0x0D52F2FF, // Color2
0xFF8000FF, // Color3
0x0FAAF4FF // Color4
};
public OnPlayerConnect(playerid)
{
//randoming array
new randomcolors = random(sizeof(Colors));
//Now use randomcolors in any codes like
SendClientMessage(playerid, Colors[randomcolors], "Welcome player" );
return 1;
}
new randomColor[10] = {COLOR_TEAL,COLOR_THISTLE,COLOR_TOMATO,COLOR_TURQUOISE,COLOR_VIOLET,COLOR_WHEAT,COLOR_WHITESMOKE,COLOR_WINDOWFRAME,COLOR_WINDOWTEXT,COLOR_YELLOW,COLOR_WHITE, COLOR_YELLOW, COLOR_RED, COLOR_GREEN,COLOR_YELLOWGREEN};
error 018: initialization data exceeds declared size
Problem This is my Line
Код:
new randomColor[10] = {COLOR_TEAL,COLOR_THISTLE,COLOR_TOMATO,COLOR_TURQUOISE,COLOR_VIOLET,COLOR_WHEAT,COLOR_WHITESMOKE,COLOR_WINDOWFRAME,COLOR_WINDOWTEXT,COLOR_YELLOW,COLOR_WHITE, COLOR_YELLOW, COLOR_RED, COLOR_GREEN,COLOR_YELLOWGREEN}; Код:
error 018: initialization data exceeds declared size |
SetPlayerColor(playerid, (random(0xFFFFFF) << 8) + 0xFF);