OnPlayerTeamPrivmsg

OnPlayerTeamPrivmsg

Description:
Callback OnPlayerTeamPrivmsg is called when a player sends a team private message through the native TPM system (/tpm).
Callback OnPlayerTeamPrivmsg was removed in SA-MP 0.3. You must make your own command using OnPlayerCommandText.
Player teams must be set with SetPlayerTeam. If not, messages will be sent to all players.


Parameters:
(playerid,text[])
int playerid The ID of the player that sent a message.
string text The text player wrote to team.


Return Values:
-


Examples:
/*
 *  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;
}
// if you want to disable the private messaging all together...

/*
 *  Disable all private team messaging.
 */
 
public OnPlayerTeamPrivmsg(playerid, text[])
{
    return false; // Disables it.
}