26 lines
567 B
C#
26 lines
567 B
C#
using GTANetworkAPI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Timers;
|
|
|
|
namespace reallife_gamemode.Server.Managers
|
|
{
|
|
public class TimeManager
|
|
{
|
|
public static void StartTimeManager()
|
|
{
|
|
Timer t = new Timer(1000);
|
|
t.Elapsed += SetTime;
|
|
|
|
t.Start();
|
|
}
|
|
|
|
private static void SetTime(object sender, ElapsedEventArgs args)
|
|
{
|
|
DateTime now = DateTime.Now;
|
|
NAPI.World.SetTime(now.Hour, now.Minute, now.Second);
|
|
}
|
|
}
|
|
}
|