That's because object is not a valid command in A1/A2. You'll need to do something like:
((getPos player) nearestObject 167794) setDammage 1
But, just to note, nearestObject only finds objects within 50 metres of the position specified; so if you want the waypoint to be further away, you'll have to set the position to a marker or gamelogic (for example), closer to the bridge.