It may also be that you get too nervous playing in front of a crowd. Just remember that it's just basketball and if you can play good during pickup games, then you can transfer that over to your play for your school. If you're struggling on the offensive end, you can always make up for it by playing tough defense and with your hustle. Also don't forget, practice!
I know people like this. You just need to admit that you get a little nervous in front of your friends because your scared of what they'll think. When you play with them just pretend your at home playing by yourself. Then you'll be comfortable around them.