PlayerSpectatePlayer
From SA-MP Wiki
Description:
Makes a player spectate (watch) another player.
(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL)
playerid | The ID of the player that will spectate. |
targetplayerid | The ID of the player that should be spectated. |
mode | The mode to spectate with (optional; defaults to 'normal'). |
Return Values:
- 1: The function executed successfully.
- 0: The function failed to execute. One of the players specified does not exist.
Important |
|
Example Usage:
public OnPlayerDeath(playerid, killerid, reason) { TogglePlayerSpectating(playerid, 1); PlayerSpectatePlayer(playerid, killerid); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- PlayerSpectateVehicle: Spectate a vehicle.
- TogglePlayerSpectating: Start or stop spectating.