---
title: "PlayerSpectatePlayer | open.mp"
description: "Makes a player spectate (watch) another player."
canonical: https://omp.itsneufox.com/docs/scripting/functions/PlayerSpectatePlayer
language: en
---

# PlayerSpectatePlayer

## Description

Makes a player spectate (watch) another player.

| Name | Description |
| --- | --- |
| playerid | The ID of the player that will spectate. |
| targetplayerid | The ID of the player that should be spectated. |
| SPECTATE\_MODE:mode | The [mode](https://omp.itsneufox.com/docs/scripting/resources/spectatemodes) to spectate with (optional; defaults to 'normal'). |

## Returns

**true** - The function was executed successfully.

**false** - The function failed to execute. One of the players specified does not exist.

## Examples

```c
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, killerid);
    return 1;
}
```

## Notes

warning

-   Order is CRITICAL! Ensure that you use TogglePlayerSpectating before PlayerSpectatePlayer.
-   playerid and targetplayerid's virtual world and interior must be the same for this function to work properly.

## Related Functions

-   [PlayerSpectateVehicle](https://omp.itsneufox.com/docs/scripting/functions/PlayerSpectateVehicle): Spectate a vehicle.
-   [TogglePlayerSpectating](https://omp.itsneufox.com/docs/scripting/functions/TogglePlayerSpectating): Start or stop spectating.
-   [GetPlayerSpectateID](https://omp.itsneufox.com/docs/scripting/functions/GetPlayerSpectateID): Gets the ID of the player or vehicle the player is spectating (watching).
-   [GetPlayerSpectateType](https://omp.itsneufox.com/docs/scripting/functions/GetPlayerSpectateType): Gets the player's spectate type.

## Related Resources

-   [Spectate Modes](https://omp.itsneufox.com/docs/scripting/resources/spectatemodes)
