View Single Post
  #1  
Old 11-16-2006, 05:32 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Something I can't figure out...

HTML Code:
function onPlayerChats()
{
  curBiz.loadVars("levels/archtype/businesses/business_" @ this.bizName @ ".arc"); 
  temp.playerChat = player.chat.tokenize();      
  switch(temp.playerChat[0].lower())
  {
    case ":addmember":
      temp.curPlayer = findPlayer(temp.playerChat[1]);
      if (temp.curPlayer == "")
      {
        return false;
      }
      if (curBiz.curMembers.index(temp.curPlayer) >= 0)
      {
        return false; 
      }
      curBiz.curMembers.add(temp.curPlayer);
    break;
           
    default: 
      temp.notSave = true; 
    break;
  }
  if (temp.notSave)
  {
    return false;
  }
  curBiz.saveVars("levels/archtype/businesses/business_" @ this.bizName @ ".arc", 0);  
  chat = curBiz.curMembers;
}
I removed a few things, as most isn't necessary for what is wrong.
Basically, it shouldn't be able to add a member that is already a member. Apparantly, 'if (curBiz.curMembers.index(temp.curPlayer) >= 0)' doesn't seem to be working. Anyone have any clues?
__________________
Reply With Quote