'John asked me if I wanted to hang out somewhere and had a barbecue with his mates.'
This is wrong. Both verbs - 'hang out' and 'have' - need to be in the infinitive form, because they are both dependent on the verb phrase 'wanted to xx'.
'John asked me if I wanted to hang out somewhere and have a barbecue with his mates.'
This is correct, for the reason above.
'John asked me if I wanted to hang out somewhere and to have a barbecue with his mates.'
This is grammatically correct, but would be better without the 'to'. This is because 'hang out somewhere and have a barbecue' are closely linked, and are essentially all part of the same proposal. You might use 'to' if John had made two unrelated suggestions.
I hope that helps.