You can use the following script to get the planned count of each Resource assigned to the Task -
TASK(SELECTED) SET_PROPERTY(PHYSICALVOL_SH, "Item", COUNT(RESOURCE))
And then use this other script to update the actual count based on the status -
TASK(STARTED OR FINISHED) SET_PROPERTY(PHYSICALVOL_AC, COUNT(RESOURCE(STATUS_NAME("Default category")=="Erected")))
If the Task Progress Type is set to Physical, this will automatically update the % complete.