I'm having a few problems. I've created a minor event thing on Era, You donate money to a guy, which adds the
''this.MaxDonater (money, amount)''
It all works, however, when trying to find out who has done the second most donated money, it causes a few problems...
Here's the script:
HTML Code:
public function ShowBridgeStats()
{
//The most money donated
echo(format(_("Most money donated: %s ($%d)"),
this.MaxDonater[1], this.MaxDonater[0]));
temp.check = getflagkeys(this.money-);
for (temp.i = 0; temp.i < temp.check.size(); temp.i++)
{
//Error down here vv
if (this.("money-" @ temp.check[temp.i]) < this.MaxDonater[0])
{
if (temp.check[temp.i] != this.MaxDonater[1] &&
temp.OldAccount != this.MaxDonater[1])
{
if (this.("money-" @ temp.check[temp.i]) < this.("money-" @ temp.OldAccount))
{
this.MaxSecondDonater = {this.("money-" @ temp.OldAccount), temp.OldAccount};
}
}
}
//Error up here^^
temp.OldAccount = temp.check[temp.i];
}
//The second max donator...
echo(format(_("2nd most money donated: %s ($%d)"),
this.MaxSecondDonater[1], this.MaxSecondDonater[0]));
}
And some flag's from the NPC:
HTML Code:
MaxDonater=3003,Raeiphon
MaxSecondDonater=3003,Raeiphon
money-Raeiphon=3003
money-Venom_Fish=102
money-xAndrewx=113
Overall_money=496782
As you can see, the second max donater is actually the first one.
It's probably a simple thing I am missing, but I can't seem to find it. If anyone could help, it'd be great, thanks!
[I used a public function to call it from another NPC]