Author Topic: Client Sided Slash Command  (Read 2012 times)

Is it possible to make a client sided slash command? if so what is the function?

Code: [Select]
function clientcommandDerp(%this,%arg,%arg2)
Depending on the command you want to use, the server will need to have a server version of the same command.

i think he wants it so that when you use /quack, it calls function quack on the client, without the server
edit: like brick text

Hmm. Couldn't you just put the quack function into client.cs along with the function clientcmdQuack thing?

i think he wants it so that when you use /quack, it calls function quack on the client, without the server
Exactly

try copying truce's code for bricktext

@bt, if you don't know what he means.

try copying truce's code for bricktext
searched, could not find.



http://forum.blockland.us/index.php?topic=140618.msg3218049#msg3218049
Where would I put in the command?
Code: [Select]
package clCmd
{
function NMH_Type::send(%this)
{
%msg = %this.getValue();
%wrd = firstWord(%msg);
%cmd = "clCmd" @ getSubStr(%wrd,1,strLen(%wrd));

if(getSubStr(%msg,0,1) $= "/" && isFunction(%cmd))
{
%eval = "call(%cmd,";
%cnt  = getWordCount(%msg);

for(%i = 1; %i < %cnt; %i++)
%eval = %eval @ "\"" @ getWord(%msg,%i) @ "\",";

eval(getSubStr(%eval,0,strLen(%eval) - 1) @ ");");
%this.setValue("");
}

Parent::send(%this);
}
};
activatePackage(clCmd);

Use the exact code from his post, and make your command start with "clCmd".

Use the exact code from his post, and make your command start with "clCmd".
Where would I put in the command?

Somewhere in the same .cs as the commands you want to activate?

Somewhere in the same .cs as the commands you want to activate?
*sigh* I mean't if I typed the command it would change $toggled to 1.