Observe and Report
(2009)

Upon failing to enter the Police Department and abruptly dropping his medication, a series of events take place around Ronnie (Seth Rogen), escalating to a very expected culmination:

Ronnie gets a gun from a closet and chases the flasher through the mall and to the store where Brandi works, where he shoots him, although not killing him, and proceeds to take him away to the Police; Brandi thanks him but, in return, he crudely disses at her for being a traitor. At the Police station, he insults the officers who had been making fun of him all along, starting for Harrison, and demands to be acknowledged as the sole catcher of the flasher.

Due to his deed, he recovers his job at the mall and hooks up with Nell; in the end, he is interviewed, along with his working mates.

Thanks Julio!