game.GetTimeScale
Açıklama
game.SetTimeScale ile ayarlanan zaman ölçeğini döndürür.
Eğer host_timescale değerini almak istiyorsanız, şunu kullanın:
Döndürülen Değer
Örnek
Gerçek zaman ölçeğini yazdırma.
-- gerçek zaman ölçeği alınıyor.
local host_timescale = math.Round( GetConVar( "host_timescale" ):GetFloat(), 1 ) -- 1.0000000149012 döndüreceği için math.Round kullanıyoruz
local game_timescale = game.GetTimeScale()
print( "True Timescale: " .. host_timescale * game_timescale )
-- gerçek zaman ölçeği örneği
if SERVER then
RunConsoleCommand( "host_timescale", 0.2 ) -- Lua tarafından oluşturulmayan bir ConVar üzerinde SetFloat kullanamayız.
game.SetTimeScale(5)
end
local host_timescale = math.Round( GetConVar( "host_timescale" ):GetFloat(), 1 ) -- 0.20000000298023 döndüreceği için math.Round kullanıyoruz
local game_timescale = game.GetTimeScale()
print( "Host_TimeScale: " .. host_timescale )
print( "Game_TimeScale: " .. game_timescale )
print( "True Timescale: " .. host_timescale * game_timescale ) -- 1 olmalı çünkü 0.2 * 5, 1'dir.
Çıktı:
True Timescale: 1
Host_TimeScale: 0.2
Game_TimeScale: 5
True Timescale: 1
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord