OnPlayerTeamPrivmsg
From SA-MP Wiki
Warning | This function was removed in SA-MP 0.3. You must make your own command using OnPlayerCommandText. |
Description:
This callback is called when a player sends a team private message through the native TPM system (/tpm).
Important | Player teams must be set with SetPlayerTeam. If not, messages will be sent to all players. |
(playerid,text[])
playerid | The ID of the player that sent a message. |
text[] | The text player wrote to team. |
Example Usage:
/* * 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. }