Top3 help
#5

Try this, read comments :
PHP код:
new top3[3] = {-1, ...};//this initilizes the array with all index value set as -1, so the array has -1's in it
top_kills = -1;

new 
onlinePlayerNumber 0;

//first getting number of online players
//because if players are less than 3 then get the top 2 or top 1 only.
for(new 0GetPlayerPoolSize(); <= ji++)if(IsPlayerConnected(i))onlinePlayerNumber++;


//Getting top 3 and store in top[3] array
for(new num 0num < (onlinePlayerNumber onlinePlayerNumber); num++)
{
    for (new 
0GetPlayerPoolSize(); <= ji++)
    {
        
// here we check if player is already not on list :
        
if(top[0] != && top[1] != && IsPlayerConnected(i))
        {
            if (
PlayerInfo[i][pRoundkills] > top_kills)
            {
                
top[num] = i;
                
top_kills  PlayerInfo[i][pRoundkills];
            }
        }
    }
    
top_kills = -1;
}

// task done now just send top 3 message
for(new 03i++)
{
    
//make sure to put this if conditon :
    
if(top[i] != -1)SendClientMessage(top[i], 0x00cc00FF"HEY! You are on top 3 list!!");

Reply


Messages In This Thread
Top3 help - by NeamPojma - 10.03.2016, 12:10
Re: Top3 help - by amirm3hdi - 10.03.2016, 13:18
Re: Top3 help - by NeamPojma - 10.03.2016, 21:27
Re: Top3 help - by NeamPojma - 11.03.2016, 13:16
Re: Top3 help - by BroZeus - 11.03.2016, 13:38
Re: Top3 help - by Sew_Sumi - 11.03.2016, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)