stef538 Posted May 3, 2020 Share Posted May 3, 2020 (edited) I don't have much experience with C++ because I mainly use C# but I wanted to try out some new things. void Notification(char* msg) { UI::_SET_NOTIFICATION_TEXT_ENTRY("STRING"); UI::_ADD_TEXT_COMPONENT_STRING(msg); UI::_DRAW_NOTIFICATION(FALSE, FALSE); } void EnableMessage(bool Enabled) { //Code for showing a message if (Enabled) { Notification("Show Month: " + TIME::GET_CLOCK_MONTH()) } } void ScriptMain() { (true) { //also tried for(;;) if (TIME::GET_CLOCK_MONTH() == 10) { EnableMessage(true); } //I set the clock month in my C# sharp script. This works. //TIME::GET_CLOCK_MONT() != 10 also don't work if (TIME::GET_CLOCK_MONTH() < 10) { EnableMessage(false); } //I set the clock month in my C# sharp script. This works. WAIT(1); } } This somehow doesn't work. When I remove if (TIME::GET_CLOCK_MONTH() < 10) it DOES work. but when I set another month the "EnableMessage" function won't stop, it just keeps on going. What am I doing wrong? EDIT It might have something to do with the CLOCK_MONTH being overridden or something because I just noticed that it switches on, then quickly switches off when it should be on. Solution Unless you use the SET_CLOCK_DATE() in a loop it will return to 0 after being set to something else. Edited May 3, 2020 by stef538 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now