GetPlayerWithMostScore????
#1

Yh.... i wanna know is it possible to find out who has THE MOST score in the server.....
NOT by pressing TAB button... but a function or sum sort of....
Reply
#2

Untested .. returns the player ID with the highest score.

pawn Код:
stock GetPlayerWithMostScore()
{
    new
        sHighestID  =   INVALID_PLAYER_ID,
        sHighest    =   0;
       
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerScore( i ) > sHighest)
        {
            sHighest = GetPlayerScore(i);
            sHighestID = i;
        }
    }
    return sHighestID;
}
Reply
#3

hmm... thx ill try
Reply
#4

how should i use it? like if i wanted a command /topplayer... GetPlayerName(sHighestID,pname); dont work...

EDIT: fixed!!! thanks a lot!!!
Reply
#5

Someone should make an include of this... LOL
nice, it helped me too : )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)