In my teens and twenties I played a lot of pickup basketball. Didn't matter where or with whom - as long as the rim had a net and the ball had air I was game.
I've written this in the past, but I continue to marvel at the life lessons you can identify in a pickup basketball game. Obvious ones such as teamwork and sportsmanship to less obvious ones such as mindfulness, confidence and restraint.
Certain days (or every summer day in NYC) the court would get crowded. It could be a two to three game wait before you get to play. So once you get on the court both teams have a lot of incentive to not lose. In basketball recognition comes to the scorers. Players that put the ball in the basket. So naturally the moment you get the ball you're making a play with the intention to score. The problem is all your teammates likely share this mindset.
Add in the influence of razzle-dazzle players like Steph Curry and Kyrie Irving whose effortless handles and pure scoring abilities are viewed with such awe that the moment a player touches the ball, they feel they must replicate Curry or Irving in order to mesmerize and garner the respect of teammates and opponents. It becomes less about the game and more about showmanship. It's a formula for losing your spot on the court and waiting another two to three games until you get back on.
So what do you do? Complain the person guarding you that your teammates are ball hogs. Or get confrontational and call out your superstar teammates to shoot less, pass the ball and make the right play. But this is pickup basketball, no one likes a player coach.
So shift your mindset, shift your responsibility: plug the hole.
If your team can't get a rebound, get in the paint and get rebounds. If an opposing player is dominating offensively offer to guard that player (always offer nicely).  If you need to set some picks to get teammates open, set the picks. The mindset is to do whatever is necessary to set your team up for success.
In most cases that means refraining from launching a three ten feet behind the line and turning around and celebrating prematurely as the ball drifts through the air.  It requires swallowing some pride and realizing that in this game your team doesn't need you to take ten shots. Identify the hole and make it a personal challenge to plug it. See how much you can influence the game even if you don't take a single shot. Teammates that know the game will appreciate you and will go out of there way to set you up offensively.
And if you win the game you get to stay on the court - and maybe in the next game you'll plug some offensive holes.
 Do it strategically and nicely. There is a lot of pride on the basketball court. If you just got scored on a couple times in a row it's embarrassing and frustrating to have a teammate tell you to switch on D. By telling you to switch with them are implying that you are not good enough to guard that player and they will now take over defensive responsibilities to show you how it's done. Don't be that teammate. Instead tell them they are doing a solid job, but you are trying to get better at defense and want to improve your skills. Ask them if they would be OK with you trying to guard their defensive assignment for a few plays. If they say no back off. But in most cases they will agree and appreciate you not showing them up on the court. It may also reciprocate back to you as they become more likely to pass you the ball in appreciation for your help defensively.
 Actually in all cases. Just don't do that. I'm a fan of confidence. But not at the cost of fundamentals. This new trend of shooting the ball and immediately celebrating by turning around and walking away because you "just know" that you made the shot is ridiculous. It's showboating and should be avoided.