14.01.2010, 22:16
my idea is to make a premium-variable for each player:
at top of your script, add
...and this callback somewhere:
for the callback (timer) being executed, you need to set it up somewhere in your OnGameModeInit()...
edit: i forgot to make the timer, now it will work (i tested, and it works well)
at top of your script, add
Код:
new PlayerColorStatus[MAX_PLAYERS]; new gColor[]={0xffff00aa,0x00ffffaa,0xff00ffaa,0xffffffaa,0x000000aa};
Код:
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]]); } } }
Код:
SetTimer("Timer",5000,true);//5 seconds (in ms)