Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:36 PM.


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