1. I'm in your plugin added a couple of lines:
    Code:
    Time = "Текущее время: {time}",
    Code:
    function PLUGIN:cmdTime(player, cmd, args)
            self:SendMessage(player, self:Parse(self.Config.Messages["Time"], { time = math.floor(Sky.Hour) }))
    end
    
    And it works. Can add to the casual players check time? Add another minute need.
     
  2. please Update for new Version ....
     
  3. I will try to update as soon as I can but currently there is an issue with some commands just not executing, which is also the case for this plugin so I need to find out why this is happening first before I can try to fix it.
     
  4. I know that this is a hard work, thank you ....
     
  5. Is there any chance to get this Plugin work ?

    #edit#
    Sorry for double posting, next Time i use "EDIT" :oops:
     
    Last edited by a moderator: Nov 26, 2014
  6. I've not yet been able to find a way, once I fix it it will be updated here.
     
  7. Fixed your plugin <3
    Code:
    -- --------------------------------------------------------------------------------------
    -- m-Time.lua
    -- --------------------------------------------------------------------------------------
    -- This plugin allows an admin modify the ingame time or freeze the time entirely.
    -- --------------------------------------------------------------------------------------PLUGIN.Title = "Time Changer"
    PLUGIN.Description = "Change the ingame time."
    PLUGIN.Version = V(0, 2, 0)
    PLUGIN.HasConfig = true
    PLUGIN.Author = "Mughisi"local Sky = nil
    local Time = nilfunction PLUGIN:Init()
        command.AddChatCommand("settime", self.Object, "cmdSetTime")
        command.AddChatCommand("freezetime", self.Object, "cmdFreezeTime")
        command.AddChatCommand("unfreezetime", self.Object, "cmdUnfreezeTime")
        command.AddConsoleCommand("env.time", self.Object, "ccmdEnvTime")
        command.AddConsoleCommand("env.freeze", self.Object, "ccmdEnvTime")
        command.AddConsoleCommand("env.unfreeze", self.Object, "ccmdEnvTime")    self:LoadSavedData() 
        timer.Once(0.1, function()
            Sky = global.TOD_Sky.get_Instance().Cycle
            Time = global.TOD_Sky.get_Instance():GetComponent("TOD_Components"):GetComponent("TOD_Time")
            if TimeData.Hour and TimeData.Frozen then
                local CurrentTime = Sky.Hour
                if(TimeData.Hour > CurrentTime) then
                    CurrentTime = CurrentTime + 24
                end
                Time:AddTime( CurrentTime-TimeData.Hour, true )
                Time.ProgressTime = not TimeData.Frozen
            end
        end)
    endfunction PLUGIN:LoadSavedData()
        TimeData = datafile.GetDataTable("m-Time")
        TimeData = TimeData or { }
    endfunction PLUGIN:SaveData()
        datafile.SaveDataTable("m-Time")
    end
    function PLUGIN:LoadDefaultConfig()
        -- General Settings:
        self.Config.Settings = {
            ChatName = "Time",
        }    -- Plugin Messages:
        self.Config.Messages = {
            SetTime = "Current time is {time}, use /settime <time> to change the time.",
            SetTimeC = "Current time is {time}, use env.time <time> to change the time.",
            SetTimeFrozen = "Time is currently frozen!",
            SetTimeSucces = "You have modified the time to {time}, time will change soon!",
            SetTimeSyntax = "The time needs to be a number between 0 and 24!",
            FreezeTimeFrozen = "Time is already frozen!",
            FreezeTimeSucces = "Time is now frozen!",
            UnfreezeTime = "Time is already running!",
            UnfreezeTimeSucces = "Time is now running again!"
        }
    endfunction PLUGIN:cmdSetTime(player, cmd, args)    if args.Length == 0 then
            self:SendMessage(player, self:Parse(self.Config.Messages["SetTime"], { time = math.floor(Sky.Hour) }))
            if not Time.ProgressTime then
                self:SendMessage(player, self.Config.Messages["SetTimeFrozen"])
            end
        elseif args.Length == 1 then
            local targetTime = tonumber(args[0])
            if not targetTime then
                self:SendMessage(player, self.Config.Messages["SetTimeSyntax"])
                return
            end
            if targetTime >= 0 and targetTime <= 24 then
                self:SetTime(targetTime)
                self:SendMessage(player, self:Parse(self.Config.Messages["SetTimeSucces"], { time = targetTime }))
            else
                self:SendMessage(player, self.Config.Messages["SetTimeSyntax"])
            end
        else
            self:SendMessage(player, self.Config.Messages["SetTimeSyntax"])
        endendfunction PLUGIN:cmdFreezeTime(player, cmd, args)
        if Time.ProgressTime then
            self:FreezeTime(true)
            self:SendMessage(player, self.Config.Messages["FreezeTimeSucces"])
        else
            self:SendMessage(player, self.Config.Messages["FreezeTimeFrozen"])
        end
    endfunction PLUGIN:cmdUnfreezeTime(player, cmd, args)
        if not Time.ProgressTime then
            self:FreezeTime(false)
            self:SendMessage(player, self.Config.Messages["UnfreezeTimeSucces"])
        else
            self:SendMessage(player, self.Config.Messages["UnfreezeTime"])
        endendfunction PLUGIN:ccmdEnvTime(arg)
        local player = nil
        local command = arg.cmd.namefull    if arg.connection then
            player = arg.connection.player
        end
       
        if command == "env.time" then
            if not arg.Args or arg.Args.Length == 0 then
                arg:ReplyWith(self:Parse(self.Config.Messages["SetTimeC"], { time = math.floor(Sky.Hour) }))
            elseif arg.Args[0] then
                local targetTime = tonumber(arg.Args[0])
                if not targetTime then
                    arg:ReplyWith(self.Config.Messages["SetTimeSyntax"])
                    return
                end
                if targetTime >= 0 and targetTime <= 24 then
                    self:SetTime(targetTime)
                    arg:ReplyWith(self:Parse(self.Config.Messages["SetTimeSucces"], { time = targetTime }))
                else
                    arg:ReplyWith(self.Config.Messages["SetTimeSyntax"])
                end
            end
        elseif command == "env.freeze" then
            if Time.ProgressTime then
                self:FreezeTime(true)
                arg:ReplyWith(self.Config.Messages["FreezeTimeSucces"])
            else
                arg:ReplyWith(self.Config.Messages["FreezeTimeFrozen"])
            end
        elseif command == "env.unfreeze" then
            if not Time.ProgressTime then
                self:FreezeTime(false)
                arg:ReplyWith(self.Config.Messages["UnfreezeTimeSucces"])
            else
                arg:ReplyWith(self.Config.Messages["UnfreezeTime"])
            end
        end    return
    endfunction PLUGIN:SetTime(time)
        TimeData.Hour = time
        if(Sky.Hour > time) then
            time = time + 24
        end
        Time:AddTime((time-Sky.Hour),true) 
        self:SaveData()
    endfunction PLUGIN:FreezeTime(bool)
        Time.ProgressTime = not bool
        TimeData.Frozen = bool
        self:SaveData()
    endfunction PLUGIN:SendMessage(target, message)
        message = UnityEngine.StringExtensions.QuoteSafe(message)
        target:SendConsoleCommand("chat.add \"" .. self.Config.Settings.ChatName .. "\"" .. message);
    endfunction PLUGIN:Parse(message, values)
        for k, v in pairs(values) do
            message = string.gsub(message, "{" .. k .. "}", v)
        end
        return message
    end
    
     
    Last edited by a moderator: Nov 27, 2014
  8. Code:
    11:31 AM [Error] Failed to load plugin m-Time (LuaScriptException: [string "m-Time.lua"]:185: <name> expected near '/')
    11:31 AM [Debug]   at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.LoadString (System.String chunk, System.String name) [0x00000] in <filename unknown>:0
      at Oxide.Lua.Plugins.LuaPlugin.Load () [0x00000] in <filename unknown>:0
      at Oxide.Lua.Plugins.LuaPluginLoader.Load (System.String directory, System.String name) [0x00000] in <filename unknown>:0
      at Oxide.Core.OxideMod.LoadAllPlugins () [0x00000] in <filename unknown>:0 
     
  9. there is no line 185 on my version ... so check you file.
     
  10. ok sorry i made a mistake by inserting the Code in a LUA File.
    mea culpa :confused:



    Ok , know it works but if i say /settime 10 the answer ist time changed to 11 ??? /settime 22 answer is time changed to 19 ???
    /freezetime says time is frozen but the time is going on !
     
    Last edited by a moderator: Nov 27, 2014
  11. edited the file, it showed the current time and not the new time. it set the time right but it just didn't show you the time you set. doesn't matter :p
    as for the time frozen, hmm
    try env.freeze
    that's what i tested and it works for me.
     
  12. This is Strange ?
    /settime answer it is 3
    /settime 10 answer you set the Time to 8
    /freezetime no function
    (F1Console) env.freeze no function



    *Edit*
    I made a Beginner Mistake.
    as I have deleted the config and data files the times are ok.
    but freeze is without function anyway
     
    Last edited by a moderator: Nov 27, 2014
  13. well freeze should work cause it works for me :x
    haven't really looked in the plugin, i just wanted to show mughisi how to fix the settime XD
     
  14. Anyway, I am grateful because I've missed this plugin.
    Big THX for your work ....
     
  15. This doesn't work again since the 12/2 update
     
  16. does it give an error?
     
  17. Nope it even says in chat that it's going to change time like it always did, just never happens
     
  18. and did you use the one i posted?
     
  19. Please update for the latest version. At the command plugin does not respond.
     
  20. Positive I did but I just replaced it with yours for sure, can't test til I get off work in 1 1/2 hours. Will let you know.
    [DOUBLEPOST=1417672180,1417649786][/DOUBLEPOST]
    Srry forgot to post after I got home. Anyway, definitely using yours and it's not working now.