enisn Posted December 26, 2020 Share Posted December 26, 2020 (edited) Everytime game crashes if client-side C# code includes `Task` with `async`, `await` operators. How can I wait a long processing task or how to wait X miliseconds in a thread? --- For example: public class InputTest : Events.Script { public InputTest() { Input.Bind(RAGE.Ui.VirtualKeys.F2, true, HandleF2Button); } private void HandleF2Button() { Chat.Output("F2 pressed. See you in 5 seconds"); Task.Factory.StartNew(async () => { await Task.Delay(5000); Chat.Output("Hello from 5 seconds later..."); }); } } Edited December 26, 2020 by enisn 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