Quote:
Originally Posted by Stefan
getstringkeys() accepts this., thiso., player., playero. etc., you can't do "anyobjectname.varname" though. For that you would need to use the with-command like
PHP Code:
with (objectname) { for (key: getstringkeys("this.inv_")) ... }
|
That's interesting. >.>
Seeing as how a friend of mine told me,
PHP Code:
for (key: getstringkeys("objectname.inv_"))
Would work.
Edit: But if I did:
Here's what I'm doing:
PHP Code:
public function inventory()
{
invcontents = new TStaticVar();
invcontents.loadVars("levels/player_" @ player.account @ ".arc");
for (i: getstringkeys("inv_"))
{
if (i == "item=")
{
tokens = getstringkeys("invcontents.inv_" @ i).substring(22).tokenize(",");
}
else if (i == "wep=")
{
//stuff
}
else if (i == "keyitem=")
{
tokens = getstringkeys("invcontents.inv_" @ i).substring(25).tokenize(",");
}
else if (i == "clothes=")
{
tokens = getstringkeys("invcontents.inv_" @ i).substring(25).tokenize(",");
}
}
}
}
Also, doing what you said and using, with, would I have to put "this.inv_" or could I just do "inv_".