Blockland Forums > Modification Help
Toggling A Mod
jes00:
Can't find anything wrong with it : /
Caust:
You forgot the opening brace for the package.
Whenever there is a syntax error, look backwards in the code and you may find it there.
jes00:
--- Quote from: Caust on September 04, 2011, 06:54:31 PM ---You forgot the opening brace for the package.
Whenever there is a syntax error, look backwards in the code and you may find it there.
--- End quote ---
If I do that then it says that is the problem.
infiniteLoop:
--- Quote from: jes00 on September 04, 2011, 07:06:43 PM ---If I do that then it says that is the problem.
--- End quote ---
Just post all of your code and let someone who knows what they are looking at fix it.
otto-san:
--- Code: ---package AutoGreeter
{
function newChatHud_addLine(%text)
{
if($canGreet == 1)
{
//Called when any line of text is added to the chat box
Parent::newChatHud_addLine(%text);
//This will turn the "jes00 connected." into "jes00"
%nameToGreet = strReplace(%text," connected.","");
//If the %nameToGreet variable is different to the original line greet them,
//otherwise it's something else
if(%nameToGreet !$= %text)
{
//Send a chat message saying hi to the player who joined (%nameToGreet)
commandtoserver('messagesent',"Hi, " @ %nameToGreet);
}
}
}
};
activatePackage(AutoGreeter);
function ToggleGreet()
if($canGreet == 1) {
$canGreet = 0;
clientCmdMessageBoxOK("Auto Greeter, by jes00","Auto Greeter is now: Off.");
} else if($canGreet == 0) {
$cangreet = 1;
clientCmdMessageBoxOK("Auto Greeter, by jes00","Auto Greeter is now: On.");
}
}
--- End code ---
logic errors, misplaced brackets, unnecessary semicolons. see if it works.