OnPlayerTeamPrivmsg
From SA-MP Wiki
OnPlayerTeamPrivmsg
This callback is called when a player sends a team private message through the native TPM system /tpm.
Important note: The players' team is set with SetPlayerTeam, or it'll send it to every player. Check that function for details.
(playerid,text[])
| playerid | The player who sent a message. |
| text[] | The text player wrote to team. |
/* * Example script to alert an admin when a team private message * has been sent. */ public OnPlayerTeamPrivmsg(playerid, text[]) { new sSenderName[24], sString[128]; GetPlayerName(playerid, sSenderName, sizeof sSenderName); format(sString, sizeof sString, "TeamMessage <%s>: %s", senderName, text); for(new iPlayer = 0 ; iPlayer < MAX_PLAYERS; iPlayer++) { if(IsPlayerAdmin(iPlayer)) { SendPlayerMessage(iPlayer, 0xFFFFFFAA, sString); } } return true; }
Or if you want to disable the private messaging all together...
/* * Disable all private team messaging. */ public OnPlayerTeamPrivmsg(playerid, text[]) { return false; // Disables it. }
