From Multi Theft Auto: Wiki
This event is triggered when a player sends a private message with msg command.
string message, player recipient
- message: a string representing the private message to be sent.
- recipient: the player to whom the message is being sent.
This example blocks players sending a PM to a player named "Bob".
function blockPM(msg,r) if (getPlayerName(r) == "Bob") then -- If they sent a PM to "Bob" cancelEvent() -- Then cancel it outputChatBox("Bob is not accepting PM's at this time.",source,255,0,0) -- And output it was cancelled. end end addEventHandler("onPlayerPrivateMessage",getRootElement(),blockPM)