Gun Accuracy Leaderboard Calculation

68 Views Asked by At

I'm working on a leaderboard system for Garry's Mod and I have run into a slight problem to do with one of the statistics I'm tracking.

I am tracking a lot of statistics including the number of bullet's shot and the number of bullets that actually hit, and am using that information to work out the accuracy of the player like so:

(gunHits / gunShots) * 100

The problem with the way I'm doing it is that people can go to the top of the leaderboards by just logging on and shooting one bullet and hitting someone with it, therefore having an accuracy of 100%.

Is there any way I can get around this?

1

There are 1 best solutions below

0
On

You could set a minimum amount of shots fired required to be ranked. I think 100 would be a good number.

On a side note you don't need to put any parenthesis on the operation since divide and multiply are operators with the same priority and they are already in the right order. It would've been necessary if you were doing it this way.

100 * (gunHits / gunShots)