CHICAGO (WLS) -- A man charged with shooting at Chicago police was on social media waving the very same gun minutes earlier, the I-Team has learned.Kentrell Pledger's Facebook page shows a video of him pointing a gun at viewers. About 45 minutes later, police said, he pointed that same gun at them and squeezed the trigger.An officer fired back but no one was hit by gunfire. Pledger was arrested and appeared before a Cook County judge on Tuesday.The video, posted at 1:28 p.m. Monday, shows him carousing with friends on a Chicago street on the Far South Side. The men were waving wads of cash, smoking and mugging for the camera.Pledger is seen in the video waving a .40-caliber pistol. Viewers are staring down the open barrel of the gun.Less than an hour before, police said Pledger used the same weapon to fire at them.At about 2:15 p.m., a police officer said he approached Pledger, a reputed member of the Black Disciple's street gang, who was acting suspiciously on West 106th Street.Pledger quickly ran away and is accused of taking a gun out from the waistband of his pants, turning and firing twice at the officer, police said. The officer returned fire."I was in my basement. I head 2 shots and I got mad, and I ran upstairs," said Michael Omar Williams, who heard the shooting. "I said, 'I'm getting sick of all of these people shooting around here.'"After an intense, but fairly short search, Pledger was arrested hiding under a neighborhood porch.In Cook County court on Tuesday, Pledger suggested that he should have finished off the cop that he shot at, shouting at Judge Adam Bourgeois, Jr. that he should have just "smoked" him.Pledger, 29, of the South Side, was denied bail and charged with attempted murder and aggravated assault of a police officer, a gun violation and drug possession.Detectives said they found heroin in Pledger's wallet when he was arrested.Prosecutors said Pledger identified himself in those social media posts as the man with the handgun. When he was arrested Pledger said, "Thank you for not shooting me," officials said.