void main()
{
    // Get the area of the object triggering the OnExit event
    object oArea = GetArea(OBJECT_SELF);

    // Check if there are any players in the area
    object oPC = GetFirstPC();
    while (GetIsObjectValid(oPC))
    {
        if (GetArea(oPC) == oArea)
        {
            // A player is still in the area, so we don't delete the spawners
            return;
        }
        oPC = GetNextPC();
    }

    // No players found in the area; delete all cas_enemyspawner placeables
    object oSpawner = GetFirstObjectInArea(oArea);
    while (GetIsObjectValid(oSpawner))
    {
        if (GetTag(oSpawner) == "CAS_ARMYSPAWNER")
        {
            DestroyObject(oSpawner);
        }
        oSpawner = GetNextObjectInArea(oArea);
    }
}
