Swiezu 3 Posted October 17, 2014 Share Posted October 17, 2014 xxx Link to comment Share on other sites More sharing options...
Premium Sanchez 2465 Posted November 11, 2014 Premium Share Posted November 11, 2014 I don't know what do you mean as "void" but do not do infinite while loops in the game, that blocks the thread. Use the built-in timer to achieve your goal: // Initialize the event static LPEVENT YourEvent = NULL; // Create the event information struct. You can pass values to the timer by adding them here. EVENTINFO(this_is_your_event_information) { // Just pass one value int value; }; // Create the function of the event EVENTFUNC(this_is_your_event) { /* This is your event function, you can do anything here */ // To reach your passed values, you have to do this this_is_your_event_information* info = dynamic_cast<this_is_your_event_information*>( event->info ); // Get the value DoSomething(info->value); // The return value is the time of your re-execution return 5 * 25; // So this function will be called again in 5 seconds } /* To start your event */ // Allocate the event informations this_is_your_event_information* info = AllocEventInfo<this_is_your_event_information>(); // Set a value of your variable info->value = 3; // Start the event YourEvent = event_create(this_is_your_event, info, 5 * 25); Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now