Blockland Forums > Modification Help
Keybinds
jes00:
I tried the following and the keybinds did not show up in the options menu.
--- Code: ---$remapDivision[$remapCount] = "Hi And Bye Mod";
$remapName[$remapCount] = "Turn Off";
$remapCmd[$remapCount] = "Client_HiAndByeMod";
$remapCount++;
function Client_HiAndByeMod(%…)
{
{
package Greet
{
function newChatHud_addLine(%text)
{
//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',"Hello " @ %nameToGreet);
}
}
};
activatePackage(Greet);
{
package Bye
{
function newChatHud_addLine(%text)
{
//Called when any line of text is added to the chat box
Parent::newChatHud_addLine(%text);
//This will turn the "jes00 has left the game." into "jes00"
%nameToFarewell = strReplace(%text," has left the game.","");
//If the %nameToFarewell variable is different to the original line greet them,
//otherwise it's something else
if(%nameToFarewell !$= %text)
{
//Send a chat message saying goodbye to the player who joined (%nameToFarewell)
commandtoserver('messagesent',"Goodbye " @ %nameToFarewell);
}
}
};
activatePackage(Bye);
}
$remapDivision[$remapCount] = "Hi And Bye Mod";
$remapName[$remapCount] = "Turn On";
$remapCmd[$remapCount] = "Client_HiAndByeModOff";
$remapCount++;
function Client_HiAndByeModOff(%…)
{
deactivatePackage(Greet);
deactivatePackage(Bye);
}
--- End code ---
Chrono:
Because you have massive syntax errors.
jes00:
--- Quote from: Chrono on July 21, 2011, 07:46:15 PM ---Because you have massive syntax errors.
--- End quote ---
This is all the console has to say about it.
Nexus:
--- Quote from: jes00 on July 21, 2011, 08:44:55 PM ---This is all the console has to say about it.
--- End quote ---
Durr - then either name it back or delete the namecheck.txt inside.
Also you have many syntax mistakes.
(%...) was obviously just to show you that some random variable goes there. Don't actually put that.
Watch how your curley brackets line up too.
You need to actually finish declaring a function before you start declaring something else.
jes00:
I can see nothing wrong with this so you will need to help me here(please)
--- Code: ---$remapDivision[$remapCount] = "Hi And Bye Mod";
$remapName[$remapCount] = "Turn Off";
$remapCmd[$remapCount] = "Client_HiAndByeMod";
$remapCount++;
function Client_HiAndByeMod(%NoIdeaWhatToPutHere)
{
{
package Greet
{
function newChatHud_addLine(%text)
{
//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',"Hello " @ %nameToGreet);
}
}
};
activatePackage(Greet);
{
package Bye
{
function newChatHud_addLine(%text)
{
//Called when any line of text is added to the chat box
Parent::newChatHud_addLine(%text);
//This will turn the "jes00 has left the game." into "jes00"
%nameToFarewell = strReplace(%text," has left the game.","");
//If the %nameToFarewell variable is different to the original line greet them,
//otherwise it's something else
if(%nameToFarewell !$= %text)
{
//Send a chat message saying goodbye to the player who joined (%nameToFarewell)
commandtoserver('messagesent',"Goodbye " @ %nameToFarewell);
}
}
};
activatePackage(Bye);
}
$remapDivision[$remapCount] = "Hi And Bye Mod";
$remapName[$remapCount] = "Turn On";
$remapCmd[$remapCount] = "Client_HiAndByeModOff";
$remapCount++;
function Client_HiAndByeModOff(%IdkWhatToPutHere)
{
deactivatePackage(Greet);
deactivatePackage(Bye);
}
--- End code ---