Entity:SelectWeightedSequence
Açıklama
Belirtilen aktivite ID'sine karşılık gelen sekans ID'sini döndürür.
Entity:GetSequenceActivity fonksiyonunun zıttıdır.
Entity:LookupSequence fonksiyonuna benzer.
Ayrıca bakınız: Entity:SelectWeightedSequenceSeeded.
Argümanlar
Döndürdükleri
Örnek
Modelin belirli bir ACT_* enum'una sahip olup olmadığını kontrol etmek ve eğer sahipse bu animasyonu oynatmak için bu hook'u kullanın.
local VModel = self:GetOwner():GetViewModel()
if ( self:Clip1() == 0 and VModel:SelectWeightedSequence( ACT_VM_RELOAD_EMPTY ) ) then
local SEQ = self:LookupSequence( ACT_VM_RELOAD_EMPTY )
if ( SEQ == -1 ) then
print( "reload" )
local EnumToSeq = VModel:SelectWeightedSequence( ACT_VM_RELOAD )
-- Normal şarjör değiştirme animasyonunu oynat
VModel:SendViewModelMatchingSequence( EnumToSeq )
else
print( "reload empty" )
local EnumToSeq = VModel:SelectWeightedSequence( ACT_VM_RELOAD_EMPTY )
-- Boş şarjör değiştirme animasyonunu oynat
VModel:SendViewModelMatchingSequence( EnumToSeq )
end
end
Çıktı: Eğer modelde varsa ACT_VM_RELOAD_EMPTY enum'unu oynatacaktır. Yoksa, normal şarjör değiştirme enum'unu oynatacaktır.
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord