Function SpawnPlayer (re)spawns a player.
  • Kills the player if they are in a vehicle and then they spawn with a bottle in their hand.
  • 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.

int 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.

if (strcmp(cmdtext, "/spawn", true) == 0)
    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 well, as they are related to this callback in one way or another.