Player:GetAmmoCount
Açıklama
Oyuncunun sahip olduğu mermi miktarını alır.
Argümanlar
Döndürülen Değerler
Örnek
Oyuncunun o anda elinde tuttuğu silahın mermisini döndüren bir fonksiyon.
function GetAmmoForCurrentWeapon( ply )
if ( !IsValid( ply ) ) then return -1 end
local wep = ply:GetActiveWeapon()
if ( !IsValid( wep ) ) then return -1 end
return ply:GetAmmoCount( wep:GetPrimaryAmmoType() )
end
Çıktı: 31
Örnek
Örnek kullanım. "pistol" mermi türünün ID'si 3'tür.
print( Entity( 1 ):GetAmmoCount( 3 ) )
print( Entity( 1 ):GetAmmoCount( "3" ) )
print( Entity( 1 ):GetAmmoCount( "pistol" ) )
Çıktı:
255
0
255
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord