Clientside /commands are enabled by using a special type of add-on that doesn't do anything on its own, but enables you to use extra functionality added by this mod. Truce's client command mod enables this, so credit to him for the code.
package clCmd {
function NMH_Type::send(%chat) {
%msg=%chat.getValue();
%wrd=firstWord(%msg);
%cmd="clCmd"@getSubStr(%wrd,1,strLen(%wrd));
if(getSubStr(%msg,0,1)$="/"&&isFunction(%cmd)) {
%eval="call(%cmd,";
for(%i=1;%i<getWordCount(%msg);%i++)
%eval=%eval@"\""@getWord(%msg,%i)@"\",";
%eval=getSubStr(%eval,0,strLen(%eval)-1)@");";
eval(%eval);
%chat.setValue("");
}
Parent::send(%chat);
}
};
activatePackage(clCmd);
function clCmdPackageOn(%c)
{
activatePackage(yourPackage);
}
function clCmdPackageOff(%c)
{
deactivatePackage(yourPackage);
}