View Single Post
  #5  
Old 04-01-2007, 07:26 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
What Chandler posted is most likely to help you, but I took about 5-6 minutes to make this

PHP Code:
// This will require the player follows this format:
// "/box 1". <- Too change the box number.

//#CLIENTSIDE
function onPlayerChats()
{

  if(
player.chat.starts("/box")) //C hecks if the player chat starts with this
  
{

    
tokens player.chat.tokenize(); //S plits the player chat into tokens
    
if(tokens[1] == 1// If this is true
    
{
      
message(1); // Changes the message to this
    
}
    else if (
tokens[1] == 2// If the above is not true and this is true
    
{
      
message(2); // Changes the message to this
    
}
  }
}

function 
onPlayerChats()
{

  if(
player.chat == "/reset"//Checks if this is the players chat
  
{
    
message(NULL); //If the above is true does this
  
}

PHP Code:
//Doesn't follow any format and you must say it as it's portrayed
//in the script.

//#CLIENTSIDE

function onPlayerChats()
{
  if (
player.chat == "/box1"// If this is true
  
{
    
message(1); // Does this
  
}
  else if (
player.chat == "/box2"// If above is not true and this is
  
{
    
message(2); // Does this
  
}
  else if (
player.chat == "/reset"// If both things above are untrue
  
{  
    
message(NULL); // Does this
  
}

The latter being much simpler and easier to understand.


Edit: I quite like how you did that by the way Chandler, really nice.

This was just posted to give a more general and, in this case, less advanced way to do things.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote