Blockland Forums > Modification Help
/command
SpreadsPlague:
--- Quote from: Obibital on July 20, 2010, 10:46:06 AM ---
servercmd's dont need to be in a function do they?
--- End quote ---
sorry, yes they do, it's 10 AM here and I haven't even slept yet
I'm sorry for the confusing advice, hopefully someone more conscious will come soon lol
sorry, your command should actually look like this
--- Code: ---function servercmdtest
{
echo("worked");
}
--- End code ---
--- Quote ---Well, i knew they were items that had %'s in front of them, like %client, or %obj, and whatnot
But what are they for? what do they do?
why do we need them? thats what i wanted to know
--- End quote ---
%client is always your client,
%obj is an object,
here's a terrible example using arguments
--- Code: ---function servercmdcompare(%a, %b)
{
if(%a == %b)
return;
else
commandtoserver('Self Delete');
}
--- End code ---
/compare X Y would then compare X to Y
if X == Y then the script does nothing and everyone is happy
however if X != Y then you die
arguments can be used in lots of ways but unfortunately I'm too tired to remember any
sorry.. so here's a helpful tip instead
= sets a variable to something
== means is equal to
%a = 1
this sets %a to 1
if(%a == 1)
this means "if %a is 1"
I hope this post helps you somehow ..
Obibital:
--- Quote from: SpreadsPlague on July 20, 2010, 10:49:56 AM ---sorry, yes they do, it's 10 AM here and I haven't even slept yet
I'm sorry for the confusing advice, hopefully someone more conscious will come soon lol
sorry, your command should actually look like this
--- Code: ---function servercmdtest
{
echo("worked");
}
--- End code ---
--- End quote ---
Thanks much though, figured id try and do something simple first :p
I can wait for your explanation XD
EDITZ: Its not reading as a function, its just reading everything as text.
**Its 11:00 here :p
SpreadsPlague:
--- Quote from: Obibital on July 20, 2010, 10:52:30 AM ---**Its 11:00 here :p
--- End quote ---
I've been up since like noon yesterday :[
anyways..
--- Quote from: Obibital on July 20, 2010, 10:52:30 AM ---EDITZ: Its not reading as a function, its just reading everything as text.
--- End quote ---
what do you mean? did you package it correctly?
Obibital:
I simply put it into a normal folder so i could edit it and execute it everytime i edit it, isnt that how you do it XD?
In other words its not i a .zip and the whole code is what you put up.
:\ i was thinking about the fact that, Dont you need something to activate the function?
SpreadsPlague:
--- Quote from: Obibital on July 20, 2010, 11:17:10 AM ---I simply put it into a normal folder so i could edit it and execute it everytime i edit it, isnt that how you do it XD?
--- End quote ---
nope, needs to be in add-on format you can type it directly into the console if you want
function servercmdtest() { echo("working"); }
--- Quote from: Obibital on July 20, 2010, 11:17:10 AM ---:\ i was thinking about the fact that, Dont you need something to activate the function?
--- End quote ---
no