Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 6cfb5a5

Browse files
committed
Now scaleform will load in time
1 parent 2ca80e6 commit 6cfb5a5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

BigMessage.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Runtime.Remoting.Messaging;
1+
using System;
2+
using System.Runtime.Remoting.Messaging;
23
using GTA;
34
using GTA.Native;
45

@@ -20,6 +21,9 @@ public void Load()
2021
if (_sc != null) return;
2122
_sc = new Scaleform(0);
2223
_sc.Load("MP_BIG_MESSAGE_FREEMODE");
24+
var timeout = 1000;
25+
var start = DateTime.Now;
26+
while (!Function.Call<bool>(Hash.HAS_SCALEFORM_MOVIE_LOADED, _sc.Handle) && DateTime.Now.Subtract(start).TotalMilliseconds < timeout) Script.Yield();
2327
}
2428

2529
public void Dispose()

0 commit comments

Comments
 (0)