PlayerSpectatePlayer

From SA-MP Wiki

Jump to: navigation, search


Description:

Makes a player spectate (watch) another player.


Parameters:
(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL)
playeridThe ID of the player that will spectate.
targetplayeridThe ID of the player that should be spectated.
modeThe 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.


Image:32px-Circle-style-warning.png

Important
Notes


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.

Personal tools