local _ostime = Oxide.Core.Libraries.Time.GetCurrentTime ()
Cannot figure out the proper namespace scope for this function. Anyone have any suggestions?
Code:using System;namespace Oxide.Core.Libraries { public class Time : Library { private readonly static DateTime epoch; public override bool IsGlobal { get { return false; } } static Time() { Time.epoch = new DateTime(1970, 1, 1); } public Time() { } [LibraryFunction("GetCurrentTime")] public DateTime GetCurrentTime() { return DateTime.UtcNow; } [LibraryFunction("GetUnixTimestamp")] public uint GetUnixTimestamp() { return (uint)DateTime.UtcNow.Subtract(Time.epoch).TotalSeconds; } } }
Solved Name space scope for GetCurrentTime()
Discussion in 'Rust Development' started by Oh_G, Oct 27, 2014.