color rand - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: color rand (
/showthread.php?tid=84493)
color rand -
Serediucr - 01.07.2009
i have new ColorsAlpha[400]={400 colors}
i have on playerconnect SetPlayerColor(playerid, ColorsAlpha[playerid]);
it compiles good , but when i connect , or every player does , it gives me a alpha green ! not random , how i want!
what to do?
Re: color rand -
Brendan_Thomson - 01.07.2009
pawn Код:
public OnPlayerConnect(playerid)
{
new random = random(sizeof(ColorsAlpha));
SetPlayerColor(playerid, ColorsAlpha[random]);
}
That should work.
Re: color rand -
Serediucr - 01.07.2009
ya , that's working thx