# GM:SpawniconGenerated

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

```lua
GM:SpawniconGenerated( string lastmodel, string imagename, number modelsleft )
```

## Açıklama

Spawn ikonu oluşturulduğunda çağrılır.

## Argümanlar

1. [string](https://gmod.tr/wiki/string) **lastmodel**: Daha önce oluşturulan modelin dosya yolu.
2. [string](https://gmod.tr/wiki/string) **imagename**: Oluşturulan ikonun dosya yolu.
3. [number](https://gmod.tr/wiki/number) **modelsleft**: Oluşturulması kalan model sayısı.

### Örnek

İkon oluşturma ilerlemesini göstermek için **garrysmod/lua/includes/gui/icon_progress.lua** dosyasında bu şekilde kullanılır.

```lua
local g_Progress = nil

hook.Add( "SpawniconGenerated", "SpawniconGenerated", function( lastmodel, imagename, modelsleft )

	if ( !IsValid( g_Progress ) ) then

		g_Progress = vgui.Create( "DPanel" )
		g_Progress:SetSize( 64+10, 64+10+20 )
		g_Progress:SetBackgroundColor( Color( 0, 0, 0, 100 ) )
		g_Progress:SetDrawOnTop( true )
		g_Progress:DockPadding( 5, 0, 5, 5 )
		g_Progress.Think = function()

			if ( SysTime() - g_Progress.LastTouch &lt; 3 ) then return end

			g_Progress:Remove()
			g_Progress.LastTouch = SysTime()

		end

		local label = g_Progress:Add( "DLabel" )
		label:Dock( BOTTOM )
		label:SetText( "remaining" )
		label:SetTextColor( Color( 255, 255, 255, 255 ) )
		label:SetExpensiveShadow( 1, Color( 0, 0, 0, 200 ) )
		label:SetContentAlignment( 5 )
		label:SetHeight( 14 )
		label:SetFont( "DefaultSmall" )

		g_Progress.Label = g_Progress:Add( "DLabel" )
		g_Progress.Label:Dock( BOTTOM )
		g_Progress.Label:SetTextColor( Color( 255, 255, 255, 255 ) )
		g_Progress.Label:SetExpensiveShadow( 1, Color( 0, 0, 0, 200 ) )
		g_Progress.Label:SetContentAlignment( 5 )
		g_Progress.Label:SetFont( "DermaDefaultBold" )
		g_Progress.Label:SetHeight( 14 )

		g_Progress.icon = vgui.Create( "DImage", g_Progress )
		g_Progress.icon:SetSize( 64, 64 )
		g_Progress.icon:Dock( TOP )

	end

	g_Progress.LastTouch = SysTime()

	imagename = imagename:Replace( "materials\\", "" )
	imagename = imagename:Replace( "materials/", "" )

	g_Progress.icon:SetImage( imagename )

	g_Progress:AlignRight( 10 )
	g_Progress:AlignBottom( 10 )

	g_Progress.Label:SetText( modelsleft )

end )
```

**Çıktı:** ![](https://gmod.tr/api/uploads/wiki/53aa87ab2f8c6b03a013.png)

- [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:SpawniconGenerated
