PHP Code:
function onCreated() {
with(findnpc("DB_Bank")) {
for(temp.pl : getstringkeys("this.acc_")) {
temp.a = makevar("this.acc_" @ pl);
echo("Player "@ pl @" has "@ a[0] @" money!");
}
}
}
This should echo all the players and what they have in rc (Those who have a this.acc_<account> variable in the database)
Now, how can we use this to find for example, those who have more then 50,000?
PHP Code:
function onCreated() {
temp.check = 50000; // What to check for
temp.p = 0;
with(findnpc("DB_Bank")) {
for(temp.pl : this.getstringkeys("this.acc_")) {
temp.a = makevar("this.acc_"@ pl);
if (a[0] >= check) {
p.add(pl);
}
}
}
/*
All the players who have 50,000 or more would be listed in the
array 'p'
*/
}
Hope this helps
PS: I made these scripts on the go, so I don't know if they work properly or not