---
title: "SetSpawnInfo | open.mp"
description: "This function can be used to change the spawn information of a specific player."
canonical: https://omp.itsneufox.com/docs/scripting/functions/SetSpawnInfo
language: en
---

# SetSpawnInfo

## Description

This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using [SetPlayerSkin](https://omp.itsneufox.com/docs/scripting/functions/SetPlayerSkin) in [OnPlayerSpawn](https://omp.itsneufox.com/docs/scripting/callbacks/OnPlayerSpawn) and/or [OnPlayerRequestClass](https://omp.itsneufox.com/docs/scripting/callbacks/OnPlayerRequestClass).

| Name | Description |
| --- | --- |
| playerid | The PlayerID of who you want to set the spawn information. |
| team | The Team-ID of the chosen player. |
| skin | The [skin](https://omp.itsneufox.com/docs/scripting/resources/skins) which the player will spawn with. |
| Float:spawnX | The X-coordinate of the player's spawn position. |
| Float:spawnY | The Y-coordinate of the player's spawn position. |
| Float:spawnZ | The Z-coordinate of the player's spawn position. |
| Float:angle | The direction in which the player needs to be facing after spawning. |
| WEAPON:weapon1 | The first spawn-weapon for the player. |
| ammo1 | The amount of ammunition for the primary spawnweapon. |
| WEAPON:weapon2 | The second spawn-weapon for the player. |
| ammo2 | The amount of ammunition for the second spawnweapon. |
| WEAPON:weapon3 | The third spawn-weapon for the player. |
| ammo3 | The amount of ammunition for the third spawnweapon. |

## Returns

This function does not return any specific values.

## Examples

```c
public OnPlayerRequestClass(playerid, classid)
{
    // This simple example demonstrates how to spawn every player automatically with
    // CJ's skin, which is number 0. The player will spawn in Las Venturas, with
    // 36 Sawnoff-Shotgun rounds and 150 Tec9 rounds.
    SetSpawnInfo(playerid, NO_TEAM, 0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0);
}
```

## Notes

warning

In case you don't need to set a team to the player, make sure that the "team" parameter is set to `NO_TEAM` (255).

Team ID 0 in open.mp is a valid team while in SA-MP it is not (SA-MP bug).

## Related Functions

-   [GetSpawnInfo](https://omp.itsneufox.com/docs/scripting/functions/GetSpawnInfo): Return the current spawn data for a player, where they will spawn next.
-   [SetPlayerSkin](https://omp.itsneufox.com/docs/scripting/functions/SetPlayerSkin): Set a player's skin.
-   [SetPlayerTeam](https://omp.itsneufox.com/docs/scripting/functions/SetPlayerTeam): Set a player's team.
-   [SpawnPlayer](https://omp.itsneufox.com/docs/scripting/functions/SpawnPlayer): Force a player to spawn.

## Related Resources

-   [Skin IDs](https://omp.itsneufox.com/docs/scripting/resources/skins)
-   [Weapon IDs](https://omp.itsneufox.com/docs/scripting/resources/weaponids)
