SpawnPlayer

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 20:47, 8 October 2019
Kwarde (Talk | contribs)
(SpawnPlayer() should be called when spectate mode is on)
← Previous diff
Revision as of 20:48, 8 October 2019
Kwarde (Talk | contribs)

Next diff →
Line 10: Line 10:
{{note|Kills the player if they are in a vehicle and then they spawn with a bottle in their hand.}} {{note|Kills the player if they are in a vehicle and then they spawn with a bottle in their hand.}}
-{{note|If a player is in spectate mode and you want to spawn them, use [[TogglePlayerSpectating]] instead.}}+{{note|If a player is in spectate mode and you want to spawn them, use [[TogglePlayerSpectating]] instead.
 +Otherwise they won't be spawned and instead will show the player flying mid-air}}
{{Example}} {{Example}}

Revision as of 20:48, 8 October 2019



Description:

(Re)Spawns a player.


Parameters:
(playerid)
playeridThe ID of the player to spawn.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. This means the player is not connected.


Image:32px-Ambox_warning_orange.png

Note

Kills the player if they are in a vehicle and then they spawn with a bottle in their hand.


Image:32px-Ambox_warning_orange.png

Note

If a player is in spectate mode and you want to spawn them, use TogglePlayerSpectating instead.

Otherwise they won't be spawned and instead will show the player flying mid-air


Example Usage:

if (strcmp(cmdtext, "/spawn", true) == 0)
{
    SpawnPlayer(playerid);
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools