OP, You will not get the points unless the room is registered in your name.
If it is registered in your name and your friend pays the bill, you will still get the points. You could 'game the system' and earn the points in this manner.
That being said, if you are a Diamond and introduce yourself as such at check-in, my expectation is that the hotel will extend some courtesies/amenities to you regardless of the room registration because Hyatt is a class act and generally do right by their loyal guests -- e.g. they get that loyalty begets loyalty.
I will also parrot what others have said, however, by repeating myself -- loyalty begets loyalty; it works both ways, and if you are not driving the revenue to the property, or paying it directly, you probably shouldn't enjoy the points in that case. Take the comp breakfast and amenities, and if they upgrade you and your friend, that will be their choice -- but I would not get greedy with points or game the system.
As a Diamond member, they take pretty care of us, and we should probably act accordingly. Just my opinion.