How to make random spawn colors?
#4

*bump*

Ok, it's now a lot more working. But now i got another problem. Everyone gets the same color if playerid 0 has spawned...

pawn Код:
new bool:Spawned[MAX_PLAYERS];

new PlayerColor[9] = {
0xE60000FF, //Red
0x1229FAFF, //Blue
0xFFFF00FF, //Yellow
0xF97804FF, //Orange
0x00C2ECFF, //Light Blue
0x38FF06FF, //Light Green
0x008040FF, //Dark Green
0xFF8080FF //Light Red
};

public OnPlayerConnect(playerid)
{
Spawned[playerid] = false;
return 1;
}

public OnPlayerSpawn(playerid)
{
new randomcolor = random(sizeof(PlayerColor));
if(Spawned[playerid] == false)
{
SetPlayerColor(playerid, PlayerColor[randomcolor]);
Spawned[playerid] = true;
}
return 1;
}
Reply


Messages In This Thread
How to make random spawn colors? - by Remi-X - 27.04.2009, 10:30
Re: How to make random spawn colors? - by Andom - 27.04.2009, 10:56
Re: How to make random spawn colors? - by Remi-X - 27.04.2009, 17:51
Re: How to make random spawn colors? - by Remi-X - 28.04.2009, 09:31
Re: How to make random spawn colors? - by Remi-X - 30.04.2009, 11:34
Re: How to make random spawn colors? - by yom - 30.04.2009, 12:38
Re: How to make random spawn colors? - by Remi-X - 30.04.2009, 13:04
Re: How to make random spawn colors? - by aspire5630 - 30.04.2009, 15:06
Re: How to make random spawn colors? - by Remi-X - 30.04.2009, 15:17
Re: How to make random spawn colors? - by aspire5630 - 30.04.2009, 16:21

Forum Jump:


Users browsing this thread: 4 Guest(s)