PlayerSpectateVehicle
From SA-MP Wiki
Description:
Sets a player to spectate another vehicle. Their camera will be attached to the vehicle as if they are driving it.
(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL)
playerid | The ID of the player who should spectate a vehicle. |
targetvehicleid | The ID of the vehicle the player should spectate. |
mode | The spectate mode. Can generally be left blank as it defaults to 'normal'. |
Return Values:
- 1: The function executed successfully. Note that success is reported if the player is not in spectator mode (TogglePlayerSpectating), but nothing will happen. TogglePlayerSpectating MUST be used first.
- 0: The function failed to execute. The player, vehicle, or both don't exist.
Important |
|
Example Usage:
TogglePlayerSpectating(playerid, 1); PlayerSpectateVehicle(playerid, vehicleid);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- PlayerSpectatePlayer: Spectate a player.
- TogglePlayerSpectating: Start or stop spectating.