Blockland Forums > Modification Help
"/" command help
Truce:
--- Quote from: Gadgethm on January 06, 2011, 06:04:29 PM ---It's not like it's banned code, it just was never publicly released. If you want I can show you the code.
-snip-
Just pop that into a client.cs, add a description and away you go.
--- End quote ---
Use this one, it supports a dynamic number of parameters (I think it works):
--- Code: ---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);
--- End code ---
otto-san:
Truce's would probably be best to use, ignore me, I haven't made a good script in ages.
Baeshra:
Once again I'm sorry but I could really use some help, just tell me what I need to know to get this script working with "/ commands", thanks.
DrenDran:
--- Quote from: Baeshra on January 06, 2011, 09:52:33 PM ---Once again I'm sorry but I could really use some help, just tell me what I need to know to get this script working with "/ commands", thanks.
--- End quote ---
You have the script, and you've been told how to make slash commands.
What part are you having trouble with?
BlockStar:
This is how you do it
--- Code: ---function serverCmdWhatEverYouWantHere
--- End code ---
replace WhatEverYouWantHere with what you want people to say when they type the command using the slash