the biggest money pocket
#6

Quote:
Originally Posted by admantis
View Post
This would require only a bit of logical thinking.
pawn Code:
new richest = INVALID_PLAYER_ID;
new amount = 0;

for(new p = 0; p < MAX_PLAYERS; p ++)
{
     if(GetPlayerMoney(p) > GetPlayerMoney(richest) || richest == INVALID_PLAYER_ID)
     {
        amount = GetPlayerMoney(p);
        richest = p;
    }
}
printf("The richest player is %d with $%d", richest, amount);
Little note if using 0.3.7: Using MAX_PLAYERS in loops is outdated in 0.3.7. GetPlayerPoolSize() is to be used.
Reply


Messages In This Thread
the biggest money pocket - by rOps - 12.03.2015, 17:33
Re : the biggest money pocket - by Golimad - 12.03.2015, 17:45
Re: Re : the biggest money pocket - by rOps - 12.03.2015, 17:47
Re : the biggest money pocket - by Golimad - 12.03.2015, 18:08
Respuesta: the biggest money pocket - by admantis - 12.03.2015, 19:20
Re: Respuesta: the biggest money pocket - by oliverrud - 12.03.2015, 19:24
Respuesta: the biggest money pocket - by admantis - 12.03.2015, 21:31

Forum Jump:


Users browsing this thread: 2 Guest(s)