SpawnPlayer
From SA-MP Wiki
Description:
(Re)Spawns a player.
(playerid)
playerid | The ID of the player to spawn. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. This means the player is not connected.
![]() Notes |
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; }
[edit]
Related Functions
The following functions may be helpful as they relate to this function in one way or another.
- SetSpawnInfo: Set the spawn setting for a player.
- AddPlayerClass: Add a class.
[edit]
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerSpawn: Called when a player spawns.