Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Tag Adder (https://forums.graalonline.com/forums/showthread.php?t=70328)

xAndrewx 11-23-2006 05:00 PM

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;
}



All times are GMT +2. The time now is 01:58 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.