![]() |
Help With For();
I am making a QMenu that gets its information from an ItemLib.
Lets say I have clientr.items= 421,320,52. I would use PHP Code:
clientr.item_421 clientr.item_320 clientr.item_52 Without having to have clientr.items |
PHP Code:
|
PHP Code:
|
for (curItem: getstringkeys("clientr.items"))
{ curItem stuff } To new one: What is 'this.library'? |
getstringkeys() requires a bit of hacking when you use it like that.
|
Quote:
Also: GraalScript: Function getstringKeys not found at line 67 in script of ItemLib (in level databases.nw at pos (30.5, 30)) |
Quote:
Works fine for me, I use it all the time: HTML Code:
this.shield_1 = {"Basic Shield", "shield1.png", "tom_icon-shield1.png"}; For the file, I think you'd need to use 'getdynamicvarnames()' |
Ahh getdynamicvarnames(); Worked, except it returns the "item_" too.
|
Maybe use file.substring(5) or maybe makevar would fix it, not too sure. =]
|
Here is the problem with substring.
PHP Code:
It only takes away the first five letters for the first string, and leaves the rest as it is |
Quote:
simple: HTML Code:
for (temp.reMake: temp.list.getdynamicvarnames("item_")) |
Now it doesnt show the commas x_X
It returns: 372402 But I fixed using PHP Code:
|
hehe, glad it works =]
|
Thanks.
|
All times are GMT +2. The time now is 09:16 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.