Quote:
Originally Posted by fowlplay4
The code I posted works, as I tested it successfully.
|
Well sort by value's 3rd param, in your posted script just now, has to be true for descending value.
But anyways.
PHP Code:
public function getTopAbyss(){
temp.guilds = getGuildList();
for (temp.g : temp.guilds) {
temp.g.kills = this.guilds.(@temp.g).kills;
}
temp.guilds.sortbyvalue("kills", null, true);
echo(temp.guilds);
}
Echoed
NPC Code:
The script of NPC db_registeredguilds has been updated by Switch
Wolfs,Owner,Poop,SDE,BTK
The script of NPC db_registeredguilds has been updated by Switch
BTK,SDE,Poop,Wolfs,Owner
The script of NPC db_registeredguilds has been updated by Switch
SDE,BTK,Wolfs,Owner,Poop
While this
PHP Code:
public function getTopAbyss(){
temp.guilds = getGuildList();
for (i=0; i<temp.guilds.size(); i++) {
temp.guilds[i].kills = this.guilds.(@temp.guilds[i]).kills;
}
temp.guilds.sortbyvalue("kills", null, true);
echo(temp.guilds);
}
Echoed
NPC Code:
The script of NPC db_registeredguilds has been updated by Switch
BTK,Poop,Owner,Wolfs,SDE
The script of NPC db_registeredguilds has been updated by Switch
Owner,BTK,Poop,Wolfs,SDE
The script of NPC db_registeredguilds has been updated by Switch
Owner,BTK,Poop,Wolfs,SDE
Note that BTK, Owner, and Poop all have 0 kills, so they can have a random order, and Wolfs has 2 kills and SDE has 22 kills.