12.03.2015, 19:20
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);