Pawel,
one of the most troublesome and important aspect of scripting for GTA/LCPD:FR is to create chunks of code that will work in sequence. There were many techniques: switch...case + enum, bool flags, while loops but I managed to create probably the best solution which is to use a list of functions that might be switched on and off. Here are some resources:
https://github.com/LtFlash/LtFlash.Common/blob/master/LtFlash.Common/Processes/ProcessHost.cs
https://github.com/LtFlash/LtFlash.Common/blob/master/Examples/Processes/ProcessHost.cs
In your code it could be used like this:
public override void OnCalloutBegin()
{
proc.ActivateProcess(IsPlayerClose);
}
public override void Process()
{
proc.Process()
}
public void IsPlayerClose()
{
if(DistanceToPlayer < 200f)
{
//createblips
proc.SwapStages(IsPlayerClose, HasPlayerClearTheArea);
proc.ActivateStage(DisplayPlayerTaskOnScreen);
}
}
private void DisplayPlayerTaskOnScreen()
{
//print msg "Eliminate enemies
}
private void HasPlayerClearTheArea()
{
if(AreEnemiesDead())
{
//print msg
End();
}
}
private bool AreEnemiesDead()
{
return (!Enemy1.Valid() || Enemy1.IsDead) && (!Enemy2.Valid() || Enemy2.IsDead);
}
Here's some information on Action delegate behind that technique:
https://www.dotnetperls.com/action
Using that, I believe you can solve your problem quickly.