Setting Random Colors not working.
#1

Random Colors Setting in OnPlayerConnect doesn't work.
It doesn't set player colors to random.

heres the code

Can someone tell me how to fix it?

pawn Код:
new Colors[11] =
{
    0xD526D9FF,
    0x00FF00FF,
    0xFF80FFFF,
    0x33CCFFAA,
    0xAFAFAFAA,
    0xFFFFFFFF,
    0xFF8000FF,
    0xFFFF00FF,
    0x0080FFC8,
    0xFF0000FF,
    0x00FF00FF
};


//OnPlayerConnect

new color = random(sizeof(Colors));
SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerColor(playerid, color);
Reply
#2

pawn Код:
new Colors[] =
{
    0xD526D9FF,
    0x00FF00FF,
    0xFF80FFFF,
    0x33CCFFAA,
    0xAFAFAFAA,
    0xFFFFFFFF,
    0xFF8000FF,
    0xFFFF00FF,
    0x0080FFC8,
    0xFF0000FF,
    0x00FF00FF
};


//OnPlayerConnect

new color = random(sizeof(Colors));
SetPlayerColor(playerid, Colors[color]);
Reply
#3

Thanks it worked!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)