Thread: Clearing Vars
View Single Post
  #9  
Old 03-31-2009, 06:54 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
awesome- thank you


Edit:

Something like this you mean, right?
HTML Code:
function onLoadCharacters() {
  for (temp.i = 1; temp.i < clientr.cha_size; temp.i++) {
    temp.list = getstringkeys("clientr.cha_" @ i @ "_");
    for (temp.var: temp.list) {
      clientr.("char_" @ i).(@ var) = clientr.("cha_" @ i @ "_" @ temp.var);
      clientr.("cha_" @ i @ "_" @ temp.var) = null;
    }
  }
}
  
function onSaveCharacters() {
  temp.list = getstringkeys("clientr.char_");
  clientr.cha_size = (temp.list.size() + 1);
  
  for (temp.i: temp.list) {
    temp.data.copyfrom(clientr.("char_" @ i));
    for (temp.var: temp.data.getdynamicvarnames()) {
      clientr.("cha_" @ i @ "_" @ temp.var) = temp.data.(@ temp.var);
    }
  }
}

Last edited by [email protected]; 03-31-2009 at 07:59 PM..
Reply With Quote