Hello! Can you help me with my problem? I try to create new callout. In this script the suspect will approach to the undercover cop, then they will talk for 3 sec, and then the chase wil start. But, when I invoke GameFiber.Sleep(), the Plugin crashes. What is wrong? Thanks.
public override void Process()
{
base.Process();
GameFiber.StartNew(delegate
{
if (!PursuitCreated && Cop.DistanceTo(Suspect.Position) < 2f)
{
GameFiber.Sleep(3000);
PursuitCreated = true;
Pursuit = Functions.CreatePursuit();
Functions.AddPedToPursuit(Pursuit, Suspect);
Functions.AddCopToPursuit(Pursuit, Cop);
Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
}
if (PursuitCreated && !Functions.IsPursuitStillRunning(Pursuit))
{
Game.LogTrivial("End executed!");
End();
}
}, "newFiber");
}