Create a script area at the origin of the map (0,0,0). Scale it to be really by (E.g 500,500,500 scale) so that the entire level is covered by the script area. Call it something like "script_area_world".
//Change this if you call your script area something different
const string WORLD_AREA = "script_area_world"
/* This function will return true if the given (colliding) entity exists & is active.
asEntity may use * and "Player". */
bool GetEntityActive(string &in asEntity)
usage would then be something like:
AddDebugMessage("Barrel 1 is active!",false);