I tried the following and it seemed to work as expected: farms no longer buildable once it's added to the queue anywhere...
EDB:
Code:
building hinterland_farms
{
convert_to hinterland_farms
levels farms farms+1 farms+2 farms+3
{
farms requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and event_counter can_build_farms 1
CS:
Code:
set_event_counter can_build_farms 1
monitor_event AddedToBuildingQueue BuildingName = farms
set_event_counter can_build_farms 0
end_monitor
However, there's no event for removing a building from the queue, nor a condition for checking that it's currently in a queue anywhere. Therefore, the above works only if the player doesn't remove it from the queue. If they do then can_build_farms will remain at 0 and therefore unbuildable anywhere, because there's no way for script to know that it needs setting back to 1.
NOTE: in the above script, once they're disabled for the player they're also disabled for all factions. A more complete example would need to deal with that somehow.