Script Name: Accuracy, Most Trigger Happy, and Most Hits
Script Description:This script has the ability to show a player his accuracy and also allows everyone to view the current best accuracy, most trigger happy, and most hits. The stats are only recorded for primary weapons.
Original Author(s): EagleEye
Core Version: 2.6.2
* Script is attachedUsage:!accuracy - Shows a player his accuracy
!stats - shows best accuracy, most trigger happy, and most hits to all players
At the end of each map it will print out the stats to everyone and reset them allBugs and issues I had to workaround:There is no way to tell what weapon does the damage to another player. This caused the error with grenades adding a hit for the player. To fix this I count throwing grenades as a fired bullet.
As if grenades didn't already cause me enough trouble, they also cause the 'Ammo' in GetPlayerStat to decrease by 1 when thrown. I had to add a small workaround for this.
When you add a bot the ForceWeapon procedure isn't called. So I had to address them joining in AppOnIdle
Some guns have multiple bullets (deagles, spas), so since a player can get multiple hits from them each shot add the number of bullets to their fired amount.
The M79 can damage a player in two ways, from the blast and from the bullet itself. Because of this I had to treat the blast as a separate bullet.
A player actually drops their gun before GetPlayerStat(ID,'Alive') returns false. I had to add a small workaround for this.
The reason I posted all the bugs and issues I ran into is if someone else wants to modify it or make their own.Hope you all enjoy it.