Scripting/Squirrel/Events/Player/onPlayerStartSpectating

From VC-MP Wiki

Jump to: navigation, search

This is called when a player starts spectating another player.

Syntax

function onPlayerStartSpectating( player, spectated )

Parameters

  • player - The pointer of the player who is spectating
  • spectated - The pointer of the player who is being spectated

Example

This example will tell the player being spectated that someone is spectating them.

function onPlayerStartSpectating( player, pSpectated )
{
     MessagePlayer( "You are currently being spectated by " + player.Name, pSpectated );
}

Notes

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

Related Events

Personal tools
squirrel scripting