> What exactly do I have to do to unlock those points that are being used for weapon unlocking?
Get to a certain level
> What exactly do I have to do to unlock those points that are being used for weapon attachments unlocking?
Kill a certain number of times with the weapon you want more attachments for.
For example: 20 kill with the Scar gives access to one attachment unlock. 1000 kills with the Scar give access to all of the attachments for only that gun.