View Single Post
  #3  
Old 04-10-2007, 10:18 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Stefan View Post
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_".
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.

Last edited by killerogue; 04-10-2007 at 10:31 AM..
Reply With Quote