Thread: Efficiency!
View Single Post
  #12  
Old 01-07-2007, 05:53 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Maybe this?

PHP Code:
function ChatBar.onAction()
{
  if (
ChatBar.text.starts("/"))
  {
    
temp.toks ChatBar.text.tokenize();
    
    
temp.args temp.toks;
    
temp.args.delete(0);
    switch(
temp.toks[0])
    {
       case 
"client1":
         
//stuff
         
return;
       case 
"client2":
         
//stuff
         
return;
       case 
"client3":
         
//stuff
         
return;
    }
    
triggerserver("gui"this.nametemp.toks[0], temp.args);
  }

Kuji made the point that there could be a fair amount of serverside commands so a case "": for all of them could get tedious...
Reply With Quote