# GM:PlayerSpawn

- **Ortam:** Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/GM:PlayerSpawn
- **Çeviri tarihi:** 2025-09-08

```lua
GM:PlayerSpawn( Player player, boolean transition )
```

## Açıklama

Bir oyuncu, yeniden doğmalar (respawn) da dahil olmak üzere her doğduğunda çağrılır.

Bir oyuncunun yalnızca ilk kez doğduğunda çağrılan bir hook için [GM:PlayerInitialSpawn](https://gmod.tr/wiki/GM:PlayerInitialSpawn)'a bakın.

Bu hook'un paylaşılan (shared) bir versiyonu için [player_spawn oyun etkinliğine](https://gmod.tr/wiki/gameevent/player_spawn) (gameevent) bakın.

> **UYARI:** Varsayılan olarak, "base" tabanlı oyun modlarında bu hook ayrıca [GM:PlayerLoadout](https://gmod.tr/wiki/GM:PlayerLoadout) ve [GM:PlayerSetModel](https://gmod.tr/wiki/GM:PlayerSetModel)'i de çağırır; bu, sizin [Entity:SetModel](https://gmod.tr/wiki/Entity:SetModel) ve [Player:Give](https://gmod.tr/wiki/Player:Give) çağrılarınızı geçersiz kılabilir. Diğer hook'ları veya 0 saniyelik bir zamanlayıcı kullanmayı düşünün.

## Argümanlar

1. [Player](https://gmod.tr/wiki/Player) **player**: Doğan oyuncu.
2. [boolean](https://gmod.tr/wiki/boolean) **transition**: Eğer `true` ise, oyuncu bir harita geçişinden yeni doğmuştur. Bu `true` olarak ayarlanmışsa muhtemelen oyuncunun silahlarına veya pozisyonuna dokunmak istemezsiniz.

### Örnek

Bir oyuncu doğduğunda bir mesaj yazdırır.

```lua
function GM:PlayerSpawn( ply )
    MsgN( ply:Nick() .. " has spawned!" )
end
```

**Çıktı:**

```lua
Player1 has spawned!
```

### Örnek

Bir hook kullanarak bir oyuncu doğduğunda bir mesaj yazdırır.

```lua
local function Spawn( ply )
	print( ply:Nick() .. " has spawned!" )
end
hook.Add( "PlayerSpawn", "some_unique_name", Spawn )
```

**Çıktı:**

```lua
Player1 has spawned!
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/GM:PlayerSpawn
