Since this is clientsided, you don't have access to messageAll. If you want to display a message to everyone, you have to use chat. commandToServer('messageSent', "message");
Second, you have to package the ClientCmd_ClientJoin (if it were a function, because the way you're using it, i'm guessing you thought it already existed).
package duckoverlords
{
function ClientCmd_ClientJoin(%client)
{
parent::ClientCmd_ClientJoin(%client);
commandToServer('messageSent', "Welcome, %client.");
}
};
activatePackage(duckoverlords);
But the above code still wouldn't work as intended.
When you want to append a non-string thing onto a string, you have to use things like @ and SPC. (There's also NL and TAB, but you don't need those here.)
package duckoverlords
{
function ClientCmd_ClientJoin(%client)
{
parent::ClientCmd_ClientJoin(%client);
commandToServer('messageSent', "Welcome," SPC %client);
}
};
activatePackage(duckoverlords);
@ appends whatever with no space, SPC appends it with a space. (obviously)
Now, one last thing. You appear to want to be able to toggle this. So we have to actually factor in whether it's on or not to the actual function.
package duckoverlords
{
function ClientCmd_ClientJoin(%client)
{
parent::ClientCmd_ClientJoin(%client);
if($JoinMessage::On)
commandToServer('messageSent', "Welcome," SPC %client);
}
};
activatePackage(duckoverlords);
Now, given that ClientCmd_ClientJoin actually existed and did what you thought it would do and had the only argument as %client, which is a string containing the player's name, that would work. (unless i made an error)