26.09.2010, 06:45
Well, I created about 17 colors I want people to spawn randomly with. I don't really understand how to do this but i tried this.
This is for the 17 colors i made
Then I did this above. I was thinks sColor would stand for Spawn Color and [ssColor] are all the 17 colors i defined.
Then I get errors..
Line 103 is
and line 351 is
Help with this would greatly be appreciated as I am trying to script a server for my clan! Thanks ffor your time.
pawn Код:
#define ssColors 17
pawn Код:
new sColor[ssColors][] = {
{0x8A2BE2FF},
{0x483D8BFF},
{0x00CED1FF},
{0x0000CDFF},
{0x002266FF},
{0xCD7F32FF},
{0xFFC1C1FF},
{0xBC8F8FFF},
{0xFF1493FF},
{0x8B4513FF},
{0xA52A2AFF},
{0xFF7F24FF},
{0x006400FF},
{0xCAFF70FF},
{0x00FF00FF},
{0xFF0000FF},
{0xFFFF00FF}
}
pawn Код:
new rColor = random(sizeof(sColor));
SetPlayerColor(playerid, sColor[rColor][1]);
Код:
(103) : error 001: expected token: ";", but found "-identifier-" (351) : error 032: array index out of bounds (variable "sColor")
pawn Код:
main()
pawn Код:
SetPlayerColor(playerid, sColor[rColor][1]);