Blockland Forums > Modification Help
serverCmd with spaces?
tyler0:
How can people setup a command with a space in it? I tried serverCmdHelp_List_Jobs and it doesn't work either.
halcynthis:
You mean arguments?
function serverCmdHello(%client,%arg)
{
messageAll('',%arg);
}
tyler0:
no. like some server have these commands that have spaces in them. Like /help list jobs
Daenth:
--- Code: ---function serverCmdhelp(%client,%arg1,%arg2)
{
if(%arg1 == "list")
{
if(%arg2 == "jobs")
{
messageClient(%client,'',"This is how arguements work!");
}
}
}
--- End code ---
Now, if you type /help list jobs it says "This is how arguements work!"
http://forum.blockland.us/index.php?topic=154416.0
Read this if you need more help.
tyler0:
--- Quote from: Daenth on June 12, 2011, 04:42:31 PM ---
--- Code: ---function serverCmdhelp(%client,%arg1,%arg2)
{
if(%arg1 == "list")
{
if(%arg2 == "jobs")
{
messageClient(%client,'',"This is how arguements work!");
}
}
}
--- End code ---
Now, if you type /help list jobs it says "This is how arguements work!"
http://forum.blockland.us/index.php?topic=154416.0
Read this if you need more help.
--- End quote ---
Thanks man
Found a little flaw. For future readers... In his script he uses "==", instead use "$=" (string to string)
--- Code: ---function serverCmdhelp(%client,%arg1,%arg2)
{
if(%arg1 $= "list")
{
if(%arg2 $= "jobs")
{
messageClient(%client,'',"This is how arguements work!");
}
}
}
--- End code ---