1. Hello,
    I want to make SkipNightVote work for hurtworld this could be done earlier with cmd("settime 0.2")
    But this isn't working anymore it gives error "The name `cmd' does not exist in the current context"
    This is what the code looked liked
    Code:
    private void VoteEnd(bool success)
            {           
                VoteOpen = false;
                RequiredVotes = 0;
                VotingTimer.Destroy();
                if (CountTimer != null)
                    CountTimer.Destroy();       
                ReceivedVotes.Clear();
                TimeRemaining = 0;            if (success)
                {
                    cmd("settime 0.2");
                    server.Broadcast($"{configData.Messaging.MainColor}{GetMSG("Voting was successful, skipping night.")}</color>");               
                }
                else
                {
                    server.Broadcast($"{configData.Messaging.MainColor}{GetMSG("Voting was unsuccessful.")}</color>");
                }
                TimeCheck = timer.Once(configData.VoteTimers.TimeBetweenVotes * 60, () => CheckTime());
            }
     
    Last edited by a moderator: Apr 9, 2017
  2. Because you must first add this function:
    Code:
    void cmd(string cmd) => ConsoleManager.Instance?.ExecuteCommand(cmd);
     
  3. Thanks that fixed it!
     
  4. Wulf

    Wulf Community Admin

    You could use the actual API from Oxide instead of code that would possibly change:
    Code:
    server.Command("settime 0.2");
    If there is an issue with time setting via SkipNightVote though, then it's likely something that needs to be fixed in the Covalence API in Oxide. Oxide/HurtworldServer.cs at develop · OxideMod/Oxide · GitHub