(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').
- 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.
public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
return 1;
}
The following functions may be useful, as they are related to this function in one way or another.