Setting Random Colors not working. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Setting Random Colors not working. (
/showthread.php?tid=399371)
Setting Random Colors not working. -
JaKe Elite - 14.12.2012
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);
Re: Setting Random Colors not working. -
Konstantinos - 14.12.2012
pawn Код:
new Colors[] =
{
0xD526D9FF,
0x00FF00FF,
0xFF80FFFF,
0x33CCFFAA,
0xAFAFAFAA,
0xFFFFFFFF,
0xFF8000FF,
0xFFFF00FF,
0x0080FFC8,
0xFF0000FF,
0x00FF00FF
};
//OnPlayerConnect
new color = random(sizeof(Colors));
SetPlayerColor(playerid, Colors[color]);
Re: Setting Random Colors not working. -
JaKe Elite - 14.12.2012
Thanks it worked!!