I have a major problem here. This is my code (pseudo):
- Code: Select all
for (int i = 0; i <= 44; i++){
//code not included irelevant
if (i == 43)
PayVault vault = player.PayVault;
//delegate
vault.Refresh(delegate(){
if (vault.Has("Gun44")){}
else { hascheated = true; Console.WriteLine("hascheted"); }
});
}
}
Console.WriteLine("hascheated?:" + hascheated);
if (hascheated == false)
{
//player.gold = goldtemp;//pui goldul player.glod de la inceput cu ceea ce se scade
player.PlayerObject.Set("gold", player.gold);
player.PlayerObject.Save();
}
It seams that the code is executed line by line until i =43 , then instead of executing the payvault check for item and put the hascheated= true; this code is postponed, has cheted remains false, the code with big db saving is executed and then after the code with payvault verification is executed.
How can i force the payvault check to be executed line by line. Help me please.