Get a error:Code:var currentlytime = System.DateTime.Now; if (!voteOpen) return; if (currentlytime > 18f || currentlytime < 24f) { OpenVote(); }
Code:error CS0019: Operator `>' cannot be applied to operands of type `System.DateTime' and `float'
System.DateTime.Now operator ">"
Discussion in 'Rust Development' started by Daat, Apr 19, 2018.
-
Code:
int currentlytime = System.DateTime.Now.Hour; if (!voteOpen) return; if (currentlytime > 18f || currentlytime < 24f) { OpenVote(); }
-
Thanks very much @Sonny-Boi ♥
-
Are you sure you're looking for the real time and not the in-game time?
-
Yeah bro is real not in game, in game is easy:
using ConVar;
Env.time > 18 && Env.time < 24
hehe