how to get the highest score in the server?
#6

like this ?
Код:
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)
        {
            team[last] = 0;
        }
        team[highestid] = 3;
    }
    last = highestid;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)