__author__ = 'BogdanWDK'
__version__ = '1.0'
import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
"""
Class
"""
class TimeCommand:
def On_PluginInit(self):
Util.ConsoleLog("TimeCommand by " + __author__ + " Version: " + __version__ + " loaded.", False)
def isMod(self, id):
if DataStore.ContainsKey("Moderators", id):
return True
return False
def On_Command(self, Player, cmd, args):
if not Player.Admin and not self.isMod(Player.SteamID):
Player.Message("You aren't an admin.")
return
if cmd == "time":
if len(args) != 1:
Player.MessageFrom("[SetTime]", "============================================")
Player.MessageFrom("[SetTime]", "In order to set time to a certain moment you must use :")
Player.MessageFrom("[SetTime]", "/time day | /time night")
Player.MessageFrom("[SetTime]", "============================================")
elif len(args) == 1:
if args[0] == "day":
World.Time = 6
elif args[0] == "night":
World.Time = 24
else:
World.Time = int(args[0])