Scripting/Squirrel/Events/Player/onPlayerChat

From VC-MP Wiki

Jump to: navigation, search

This is called when a player speaks in the main chat. This is called even if the player is muted.

Syntax

function onPlayerChat( player, message )

Parameters

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

Example

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

function onPlayerChat( player, 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