Dynamically adjust bandwidth base on active users playiung

i have 12 computers on the internet cafe and what i did is divide my 6M bandwidth to two, two parts, mainly 3M for online gaming(250kbits on each computers) and 3M for Browsing(http/https), . now what i’d like to know is how to adjust my 3M bandwidth for Online browsing when there are only few online gamers. for example if there are only four online gamers(that would probably eat 1M maximum on the online gaming bandwidth), how can i “give/share” the 2M bandwidth to the browsing allocated bandwidth. i have attached an image for your reference, pls look at scenario 1 and 2 and with the adjust bandwidth for browsing http://postimg.org/image/3zs4qb8gp/ i would like to know if you have script for this(detect # of active online gamers, and that could run about every 20 or 30 seconds, just to adjust the total bandwidth for online browsing. what it would benefit is the online browsers, since only few users are using the online gaming bandwidth(might as well share it to users that are browsing/downloading)