23.08.2010, 02:02
You just have to use this, if you want to set the player whom has the highest score in another team:
pawn Код:
forward High();
public High()
{
static last; //it's static because it's like a global variable
new highestid = INVALID_PLAYER_ID, highest = -1;
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(GetPlayerScore(i) > highest)
{
highestid = i;
highest = GetPlayerScore(i);
}
}
if(highestid != INVALID_PLAYER_ID)
{
if(last != highestid)
{
//do something to remove the last one with highest score from the team
}
team[highestid] = 3;
}
last = highestid;
}

