Die Fehlermeldungen wäre sehr hilfreich. Bitte verwende Code Tags für Deinen Code. Im wesentlichen sollte es so gehen:

Code:
var ent_handle = 0;

void wait_for_entity_to_die()
{
  while (ent_handle == 0) // wait until the handle gets set.
    wait(1);
  while (ptr_for_handle(ent_handle)) // wait until the entity gets removed.
    wait(1);
  error("The entity was removed.")
}



Always learn from history, to be sure you make the same mistakes again...