Thread: Tag Adder
View Single Post
  #1  
Old 11-23-2006, 05:00 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
Tag Adder

Add the parts inside of /* */ in to a level, and then name the class 'tagadder' and it'll work!

HTML Code:
/*
function onCreated()
{
  this.curGuild = "Guild Name";
  this.guildOwner = "Owner's account";
  
  this.join("tagadder");
}
*/
function onPlayerChats()
{
  if (this.curGuild == "")
  {
    return false;
  }
  if (player.account != this.guildOwner)
  {
    return false;
  }
  temp.curTokens = player.chat.tokenize();
  switch(temp.curTokens[0])
  {
    case ":addMember":
      this.curPlayer = this.findCurPlayer(temp.curTokens[1]);
      if (!this.curPlayer)
      {
        return false;
      }
      addguildmember(this.curGuild, temp.curTokens[1], temp.curTokens[2]);
      say2("Added" SPC temp.curTokens[1] @ "(" @ temp.curTokens[2] @ ")!");
    break;

    case ":removeMember":
      removeguildmember(this.curGuild, temp.curTokens[1]);
      say2("Removed" SPC temp.curTokens[1]);
    break;
    
    case ":help":
      say2(":addMember ''account'' ''nickname'' \n:removeMember ''account''");
    break;
  }
  
}
function findCurPlayer(newMember)
{
  if (findplayer(temp.newMember) == NULL)
  {
    return false;
  }
  return true;
}
__________________
Reply With Quote