Scripting/Squirrel/Events/Player/onPlayerStartSpectating
From VC-MP Wiki
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
- onPlayerJoin
- onPlayerPart
- onPlayerCrashDump
- onPlayerSpawn
- onPlayerDeath
- onPlayerKill
- onPlayerTeamKill
- onPlayerChat
- onPlayerAction
- onPlayerPM
- onPlayerFailedPM
- onPlayerTeamChat
- onPlayerCommand
- onPlayerHealthChange
- onPlayerArmourChange
- onPlayerWeaponChange
- onPlayerCashChange
- onPlayerScoreChange
- onPlayerKeyStateChange
- onPlayerMove
- onPlayerRequestClass
- onPlayerRequestAmmunation
- onPlayerRequestAmmuWeapon
- onPlayerStartSpectating
- onPlayerExitSpectating
- onPlayerRconLogin
- onPlayerRconLoginAttempt
- onPlayerFall
- onPlayerVersion
