# player\_connect

- **Ortam:** İstemci, Sunucu, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/gameevent/player_connect
- **Çeviri tarihi:** 2025-09-08

## Açıklama

Bir oyuncu sunucuya bağlandığında çağrılır.

> **NOT:** Bu, yalnızca dinleme sunucusu (listen server) sahibi için hem sunucu tarafında (serverside) hem de istemci tarafında (clientside) çağrılır. Diğer durumlarda sunucu tarafında çağrılır.

## Üyeler

- [number](https://gmod.tr/wiki/number) **bot**

  Eğer oyuncu bir bot değilse 0, bot ise 1'dir.

- [string](https://gmod.tr/wiki/string) **networkid**

  Oyuncunun sahip olduğu [SteamID](https://gmod.tr/wiki/Player:SteamID).

  > **NOT:** Botlar için `BOT`, tek oyunculu modda `STEAM_0:0:0` veya `STEAM_ID_PENDING` ve `-multirun` istemci seçeneği kullanıldığında `STEAM_ID_LAN` olacaktır.

- [string](https://gmod.tr/wiki/string) **name**

  Oyuncunun sahip olduğu [isim](https://gmod.tr/wiki/Player.Nick).

- [number](https://gmod.tr/wiki/number) **userid**

  Oyuncunun sahip olduğu [UserID](https://gmod.tr/wiki/Player:UserID).

- [number](https://gmod.tr/wiki/number) **index**

  Oyuncunun [varlık (entity) indeksi](https://gmod.tr/wiki/Entity.EntIndex), eksi bir.

- [string](https://gmod.tr/wiki/string) **address**

  Bağlanan oyuncunun [IP Adresi (IPAddress)](https://gmod.tr/wiki/Player:IPAddress). Botlar için `none`, dinleme sunucusu (listen server) ve tek oyunculu mod sahipleri için `loopback` olacaktır.

## Örnekler

### Örnek

Bir oyuncunun bağlandığını herkese duyurun.

```lua
gameevent.Listen( "player_connect" )
hook.Add("player_connect", "AnnounceConnection", function( data )
	for i, ply in ipairs( player.GetAll() ) do
		ply:ChatPrint( data.name .. " sunucuya bağlandı." )
	end
end)
```

**Çıktı:** `Player1 sunucuya bağlandı.`

- [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/gameevent/player_connect
