change player color
#7

my idea is to make a premium-variable for each player:
at top of your script, add
Код:
new PlayerColorStatus[MAX_PLAYERS];
new gColor[]={0xffff00aa,0x00ffffaa,0xff00ffaa,0xffffffaa,0x000000aa};
...and this callback somewhere:
Код:
forward Timer();
public Timer()
{
	for (ID=0;ID<MAX_PLAYERS;ID++)
	{
		if(IsPlayerAdmin(ID)==1)//replace the "IsPlayerAdmin(ID)" with "pInfo[ID][perfect]", and it will work for your desired condition...
		{
			PlayerColorStatus[ID]=(PlayerColorStatus[ID]+1)%sizeof(gColor);//this will "rotate" through the (5 atm) colors
			SetPlayerColor(ID,gColor[PlayerColorStatus[ID]]);
		}
	}
}
for the callback (timer) being executed, you need to set it up somewhere in your OnGameModeInit()...
Код:
	SetTimer("Timer",5000,true);//5 seconds (in ms)
edit: i forgot to make the timer, now it will work (i tested, and it works well)
Reply


Messages In This Thread
change player color - by `FuTuRe- - 13.01.2010, 13:03
Re: change player color - by `FuTuRe- - 13.01.2010, 14:44
Re: change player color - by Babul - 13.01.2010, 19:18
Re: change player color - by `FuTuRe- - 14.01.2010, 11:34
Re: change player color - by Klutty - 14.01.2010, 13:13
Re: change player color - by `FuTuRe- - 14.01.2010, 13:23
Re: change player color - by Babul - 14.01.2010, 22:16
Re: change player color - by Retardedwolf - 14.01.2010, 23:37

Forum Jump:


Users browsing this thread: 1 Guest(s)