SpawnPlayer
From SA-MP Wiki
SpawnPlayer
Rather then waiting until someone is ready to spawn (or if you just want to respawn the player for any reason), this is the function you should use. This function immediately respawns the player on the location set by AddPlayerClass or SetSpawnInfo. The function is working perfectly.
(playerid)
| playerid | The PlayerID of the player who needs to respawn. |
if (strcmp(cmdtext, "/spawnme", true) == 0) { SpawnPlayer(playerid); return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- SetSpawnInfo: Set the spawn setting for a player.
- AddPlayerClass: Add a class.
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.
