There is no way to use GTAV story mode cheats in Online play, sorry to break it to you. Though to be honest, earning money in GTA:O isn't hard. While a lot of the big ticket items are a hassle to grind for unless you have a group of friends who are competent enough to do heists, and even then it's kind of grindy, ammo is so relatively cheap it's easy to max out on it without having making any serious dent on your funds, unless you're the type of person who feel that rocket launchers are the solution for every problem that arises.