View Single Post
  #1  
Old 07-14-2006, 02:28 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
My little problemo!

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]
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote