# NPC:HasCondition

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

```lua
boolean NPC:HasCondition( number condition )
```

## Açıklama

NPC'nin belirtilen duruma sahip olup olmadığını döndürür.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) **condition**: Durum indeksi, bkz. [COND enum](https://gmod.tr/wiki/Enums/COND).

## Döndürülen Değer

1. [boolean](https://gmod.tr/wiki/boolean): Eğer NPC belirtilen duruma sahipse true, aksi takdirde false.

### Örnek

Bir NPC'nin sahip olduğu durumların bir listesini yazdıran fonksiyon.

```lua
function ListConditions(npc)

	if(!IsValid(npc)) then return end

	print(npc:GetClass().." ("..npc:EntIndex()..") has conditions:")

	for c = 0, 100 do

		if(npc:HasCondition(c)) then

			print(npc:ConditionName(c))

		end

	end

end
```

**Çıktı:** (Sunucu konsoluna):

npc_antlion (120) şu durumlara sahip:

COND.IN_PVS

COND.NO_WEAPON

COND.HAVE_ENEMY_LOS

COND.TOO_FAR_TO_ATTACK

COND.NO_HEAR_DANGER

COND.FLOATING_OFF_GROUND

- [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/NPC:HasCondition
