Skip to content

OnPlayerSpawn

Usage

  • No return behavior

Example Autogenerated

csharp
private void OnPlayerSpawn(  )
{
    Puts( "OnPlayerSpawn works!" );
}

Location

  • ServerMgr::SpawnNewPlayer(Network.Connection connection)
csharp
public BasePlayer SpawnNewPlayer(Connection connection)
{
	BasePlayer.SpawnPoint spawnPoint = ServerMgr.FindSpawnPoint(null);
	BasePlayer basePlayer = GameManager.server.CreateEntity("assets/prefabs/player/player.prefab", spawnPoint.pos, spawnPoint.rot, true).ToPlayer();
	if (Interface.CallHook("OnPlayerSpawn", basePlayer, connection) != null)
	{
		return basePlayer;
	}
	basePlayer.health = 0f;
	basePlayer.lifestate = BaseCombatEntity.LifeState.Dead;
//---

Released under the MIT License.