![]() |
can someone tell me how to do this?
okay:
we have a database that stores all bank accounts and the money in them. I want to make something so I can loop through the flags in the database and get all ones that are greater than a certain amount. for example if I said /npc checkbanks 500000 it would tell me all the accounts in the database that had 500,000 or more. tig did it for us a while ago so I know it's possible. I just don't know how to approach this. I can do the obvious: for (pl: allplayers) { echo(pl SPC "has" SPC DB_Bank.("acc_" @ pl)[0]); } but that would only give me the ones that are online. I need to see offline ones too. |
PHP Code:
Now, how can we use this to find for example, those who have more then 50,000? PHP Code:
PS: I made these scripts on the go, so I don't know if they work properly or not |
Quote:
|
getstringkeys() will get the variables that start with whatever parameter you provide. getdynamicvarnames() simply gets a list of all dynamic variables.
|
Quote:
PHP Code:
|
Quote:
|
I have a question, why was it deleted in the first place, Frankie? o_o
|
Quote:
Just like when we were outside for 5 hours at school today for a bomb threat, and they were like "LOL IT WAS JUST DRILL .. DONT MIND HAZMAT, BOMB SQUAD, FIRE TRUCKS ETC" |
this.blah.foo.bar
getstringkeys("this.blah") would give you "foo.bar" while this.blah.getdynamicvarnames() would give you just "foo". |
Quote:
|
Quote:
|
Quote:
|
didn't i do this for era like three years ago?
anyway, here's a better script probably. change the loop at the bottom and it'll give you the top richest players etc PHP Code:
|
thank you.
"sidney" yours works well. :D |
it's not a problem he he :):):)
|
| All times are GMT +2. The time now is 08:15 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.