Thread: Chat functions
View Single Post
  #1  
Old 05-29-2007, 06:42 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
Chat functions

HTML Code:
function onActionServerside(playersChat)
{
  temp.chatTokens = temp.playersChat.tokenize();
  switch(temp.chatTokens[0])
  {
    case "help": 
      player.displayHelp(); 
    return true;
    
    case "summon": 
      findplayer(temp.playersChat.substring(7)).setlevel2(player.level.name, player.x, player.y); 
    return true;
    
    case "addItem":
      player.addItem(temp.chatTokens[1], temp.chatTokens[2]);
    break;
    
    case "removeItem":
      player.removeItem(temp.chatTokens[1], temp.chatTokens[2]);
    break;
    
    case "gani":
      setani(temp.playersChat.substring(4), "");
    break;
    
    case "clear":
      //Place holder [-systemMessages]
    break;
    
    default:
      temp.displayMessage = "No such command...";
    break;
  }
  if (temp.displayMessage)
  {
    player.addMessage("No such command!", "-system");
  }
}

//#CLIENTSIDE
function onPlayerChats()
{
  if (!disableChat)
  {
    if (player.chat.starts("/"))
    {
      triggerserver("weapon", this.name, player.chat.substring(1));
      player.chat = " ";
    }
  }
   else
  {
    player.chat = " ";
  }
} 
Here's a basic chat function thing
__________________
Reply With Quote