NPC:GetNPCState
Açıklama
NPC'nin durumunu döndürür.
Döndürdükleri
Örnek
Sunucu konsoluna boşta duran NPC'lerin bir listesini yazdıran fonksiyon.
function ReportIdleNPCs()
for i, npc in ipairs( ents.FindByClass( "npc_*" ) ) do
if IsValid( npc ) and npc:IsNPC() and npc:GetNPCState() == NPC_STATE_IDLE then
print( "Ent #" .. npc:EntIndex() .. ": " .. npc:GetClass() .. " is idle." )
end
end
end
Çıktı: (Sunucu konsoluna)
Ent #111: npc_citizen is idle.
Ent #120: npc_citizen is idle.
Ent #122: npc_citizen is idle.
Ent #124: npc_citizen is idle.
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord