Scripting/Squirrel/Events/Player/onPlayerAction

From VC-MP Wiki

Jump to: navigation, search

This is called when a player does a /me action. This is called even if the player is muted.

Syntax

function onPlayerAction( player, message )

Parameters

  • player - The pointer of the player
  • message - The 'action' player did using /me

Example

This example kills the player if they type '/me dies'.

function onPlayerAction( player, text )
{
     if ( text == "dies" )
     {
          player.Health = 100;
          MessagePlayer( "You are now dead.", player );
     }
}

Notes

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

Related Events

Personal tools
squirrel scripting