# spawnmenu.AddContentType

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/spawnmenu.AddContentType
- **Çeviri tarihi:** 2025-09-08

```lua
spawnmenu.AddContentType( string name, function constructor )
```

## Açıklama

Yaratma listelerine (spawnlist) kaydedilebilen yeni bir içerik türü kaydeder. [spawnmenu.CreateContentIcon](https://gmod.tr/wiki/spawnmenu.CreateContentIcon) tarafından oluşturulur/çağrılır.

## Argümanlar

1. [string](https://gmod.tr/wiki/string) **name**: İçerik türünün benzersiz adı.
2. [function](https://gmod.tr/wiki/function) **constructor**: Bu içerik türü için yeni bir panel oluşturmamız gerektiğinde çağrılan bir fonksiyondur. Fonksiyon argüman(lar)ı: 1. [Panel](https://gmod.tr/wiki/Panel) **container** - [spawnmenu.CreateContentIcon](https://gmod.tr/wiki/spawnmenu.CreateContentIcon)'dan gelen yeni panelin konteyneri/ebeveyni. 2. [table](https://gmod.tr/wiki/table) **data** - [spawnmenu.CreateContentIcon](https://gmod.tr/wiki/spawnmenu.CreateContentIcon)'dan aktarılan içerik türü için veriler. Fonksiyon dönüş değeri(değerleri): 1. [Panel](https://gmod.tr/wiki/Panel) **pnl** - Oluşturulan panel.

### Örnek

Basit bir başlık (header) içerik türü.

```lua
spawnmenu.AddContentType( "header", function( container, obj )

	if ( !obj.text or type(obj.text) != "string" ) then return end

	local label = vgui.Create( "ContentHeader", container )
	label:SetText( obj.text )

	container:Add( label )

end )
```

- [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/spawnmenu.AddContentType
