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.name, temp.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...