I just recently scripted a mailing system and I am now scripting the part that states who has the most letters sent.
PHP Code:
for (i: allplayers){
temp.player = findPlayer(i);
this.sentmail.(@temp.player) = temp.player.clientr.sentmailamt;
}
I get it to output in the flags of the npc 'Mail':
PHP Code:
sentmail.MandangoP2P=19
sentmail.rapidwolve=2
sentmail.Spike5656=0
I then use a function 'calcMostSent' to determine who sent the most I am stumped at this part, I have no clue what to do. I've tried:
PHP Code:
for (j: this.sentmail.getdynamicvarnames()){
if (this.sentmail.(@j) > this.sentmail(@j[j+j-1]){
this.mostsent = this.sentmail.(@j);
this.mostsentacc = j;
}
}
Don't even ask why I did that, because I was just guessing X_x. I tried alot of other ways but it hasn't worked. Can somebody help me?