Nailguns in games are rarely seen being used as tools - most often, the protagonist repurposes a nailgun as a weapon, or the device is simply weaponized from the beginning. Real nail guns are of course not effective weapons, much less at long range.
The first game to feature a nailgun weapon was Quake, where it fires armor-piercing "nails" from two side-by-side barrels. The weapon is very accurate with no recoil, and effective from long distances.
The HV Penetrator in the F.E.A.R. franchise is a favorite among players and has become an icon of the series. With high damage and accuracy, it fires 10mm armor-piercing steel rods that can pin enemies's bodies to surfaces.