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()); }
Solved Running a server command?
Discussion in 'Hurtworld Development' started by Swat1801, Apr 9, 2017.
-
Because you must first add this function:
Code:void cmd(string cmd) => ConsoleManager.Instance?.ExecuteCommand(cmd);
-
-
Wulf Community Admin
Code:server.Command("settime 0.2");