Scripting/Squirrel/Events/Player/onPlayerPM

From VC-MP Wiki

Jump to: navigation, search

This is called when a player sends a personal message to another player. This is called even if the player is muted.

Syntax

function onPlayerPM( player, playerTo, message )

Parameters

  • player - The pointer of the player
  • playerTo - The pointer of the message receiver
  • message - The message player said

Example

This example checks if the player has been muted and reminds them if they have.

function onPlayerPM( player, playerTo, text )
{
     if ( player.IsMuted )
     {
          MessagePlayer( "You are currently muted so nobody can hear you.", player );
     }
}

Notes

The functions MessagePlayer and player.IsMuted were used in in this example. More info about them in corresponding pages.

Related Events

Personal tools
squirrel scripting