Blockland Forums > Modification Help
Toggling A Mod
(1/7) > >>
jes00:
Could someone help me to toggle this mod with a console command?

--- 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 autogreetOn(%canGreet);
%canGreet = 1;
commandToClient(%a,'messageBoxOk',"Auto Greeter, by jes00","Auto Greeter is now: On.");

function autogreetOff(%canGreet);
%canGreet = 0;
commandToClient(%a,'messageBoxOk',"Auto Greeter, by jes00","Auto Greeter is now: Off.");
--- End code ---
Sulfate:
didn't you already put one at the bottom

jesus your formatting is horrible. and did you actually make this mod or was it from a tutorial? I see your name in there, but the function to turn it off (although it looks broken) is clearly right there in front of you, yet you still ask how to turn it on/off..

jes00:

--- Quote from: Sulfate on September 02, 2011, 09:18:25 PM ---but the function to turn it off (although it looks broken) is clearly right there in front of you, yet you still ask how to turn it on/off..

--- End quote ---
I'm asking cause my attempt is not working.
infiniteLoop:
I am not going to help until you fix the indentation sorry. If I liked looking through crap, I'd be studying to become a crapologist.
Uxie:

--- Code: ---//Make all of your %canGreet's to $canGreet for this to actually work.
//If you want this to start out in on, make the script have a $canGreet = 1.
function togglegreet() {
if($canGreet == 1) {
$cangreet = 0;
} else if($canGreet == 0) {
$cangreet = 1;
}
}
--- End code ---
Make sure you know what your doing and read the //'s.

Warning - while you were typing a new reply has been posted. You may wish to review your post.
Warning - while you were typing a new reply has been posted. You may wish to review your post.
no fu
Navigation
Message Index
Next page

Go to full version