Thread: Clearing Vars
View Single Post
  #1  
Old 03-30-2009, 07:32 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
Clearing Vars

I don't understand why these vars are not storing? They're being deleted once I reconnect

PHP Code:
function onCreated() {
  echo(
"Size:" SPC this.getCharacterList());
  
  for (
temp.0temp.5temp.i++) {
    
this.onCharacterCreate();
  }

  echo(
"Size:" SPC this.getCharacterList());
}

function 
onCharacterCreate() {
  
temp.charsize this.getCharacterList().size();
  if (
temp.charsize >= 15) return false;
  
  
temp.char.level 1;
  
temp.char.exp int(random(2099));
  
temp.char.gender randomstring("Male""Female");
  
temp.char.brave int(random(110));
  
temp.char.faith int(random(110));
  
temp.char.move int(random(510));

  
temp.stats = {"str""dex""con""int""wis""cha"};
  for (
temp.itemp.stats) {
    
temp.char.(@ i) = int(random(516));
  }
  
  
temp.char.hpmax int(random(75110));
  
temp.char.mpmax int(random(75110));

  
temp.list = {"Squire""Knight""Chemist"};
  
temp.class = randomstring(temp.list);
  
temp.char.classes temp.list;
  
temp.char.class = temp.class; 
  
temp.char.(@ temp.class).level 1;
  
temp.char.(@ temp.class).exp temp.char.exp;
  
temp.char.(@ temp.class).jp int(random(525));
  
  
temp.buffs = { {"dex""str""hpmax"}, //Squire
                 
{"str""con""hpmax"}, //Knight
                 
{"int""wis""mpmax"//Chemist
               
};
  for (
temp.itemp.buffs[temp.list.index(temp.class)]) {
    
temp.char.(@ i) += int(random(515));
  }
  
  
temp.char.hp temp.char.hpmax;
  
temp.char.mp temp.char.mpmax;
  
  
this.clientr.("char_" @ (temp.charsize 1)).copyfrom(temp.char);
  echo(
"Created" SPC temp.charsize 1);
}

function 
getCharacterList() {
  return 
getstringkeys("this.clientr.char_");

Any suggestions? thanks

[Don't comment on the this.clientr/clientr, that isn't the problem]
Reply With Quote