The join message would be:
messageAll('MsgClientJoin', '\c1%1 connected.', "player name");The leave message is more complicated if you also need the sound that goes with it, as this is normally handled in a secure command which you can't call.
First, create a sound datablock:
datablock AudioProfile(LeaveSound)
{
filename = "base/data/sound/playerLeave.wav";
description = Audio2D;
preload = true;
};
TransmitDatablocks();
Then to send the message and play the sound:
messageAll('', '\c1%1 has left the game.', "player name");
ServerPlay2D(LeaveSound);
I think it would work, but you'll have to test it.