Use
?(getdammage object *****):
To find out what damage a bridge section has suffered
Damage to an object ranges from "0" no damage to "1" Fully damaged
The example below looks at all the object numbers of the bridge sections for the Nogova bridge
If any section receives any damage it repairs all sections
If you have created bridge sections using an addon, then give each bridge section a name, so the scriopt lines would look like the following
?(getdammage XXXX):
where "XXXX" is the name you gave the object
Modify the script which you can run from the Init.sqs using the line
[] exec "Bridgerepair.sqs"
;Bridgerepair.sqs
#Start
~5
?(getdammage object 167669 > 0.1):goto "Repair"
?(getdammage object 167792 > 0.1):goto "Repair"
?(getdammage object 167793 > 0.1):goto "Repair"
?(getdammage object 167794 > 0.1):goto "Repair"
?(getdammage object 167795 > 0.1):goto "Repair"
?(getdammage object 167797 > 0.1):goto "Repair"
goto "START"
#Repair
~1
object 167669 setdammage 0
object 167792 setdammage 0
object 167793 setdammage 0
object 167794 setdammage 0
object 167795 setdammage 0
object 167797 setdammage 0
goto "START"