Setting maximun number of weapons

I was wondering if there was a gamemode function to get and to set the maximum number of weapons that a player can have or if there is another way to do this.