Blockland Forums > Modification Help
messageclient(); does not work?
Nexus:
and get rid of every return;
You do not need them and they will cause issues with other functions if you return before the parent
deathrider:
ok
--- Code: ---package AutoMessage
{
function GameConnection::onconnect(%client)
{
%name = findclientbyname(%client);
%random = getrandom(0, 4);
if(%random == 1)
{
commandtoserver('messagesent',"Hey " @ %name @ " how ya going.");
}
if(%random == 2)
{
commandtoserver('messagesent',"Whats up" @ %name @ ".");
}
if(%random == 3)
{
commandtoserver('messagesent',"Welcome to my server" SPC %name);
}
if(%random == 4)
{
commandtoserver('messagesent',"Yay more people are joining");
}
parent::onconnect(%client);
}
activatepackage(AutoMessage);
--- End code ---
deathrider:
the last line it says errors THERE ARE NONE
this is from console
--- Code: ---Loading Add-On: Script_AutoMessage
Add-Ons/Script_AutoMessage/server.cs Line: 31 - Syntax error.
>>> Some error context, with ## on sides of error halt:
if(%random == 3)
{
commandtoserver('messagesent',"Welcome to my server" SPC %name);
}
if(%random == 4)
{
commandtoserver('messagesent',"Yay more people are joining");
}
parent::onconnect(%client);
}
activatepackage(##A##utoMessage);
>>> Error report complete.
--- End code ---
elm:
--- Quote from: deathrider on April 09, 2012, 04:01:26 AM ---the last line it says errors THERE ARE NONE
this is from console
--- Code: ---Loading Add-On: Script_AutoMessage
Add-Ons/Script_AutoMessage/server.cs Line: 31 - Syntax error.
>>> Some error context, with ## on sides of error halt:
if(%random == 3)
{
commandtoserver('messagesent',"Welcome to my server" SPC %name);
}
if(%random == 4)
{
commandtoserver('messagesent',"Yay more people are joining");
}
parent::onconnect(%client);
}
activatepackage(##A##utoMessage);
>>> Error report complete.
--- End code ---
--- End quote ---
You have:
}
activatePackage(autoMessage);
It should be:
};
activatePackage(autoMessage);