Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: mikembm on August 22, 2007, 10:14:24 pm

Title: Accuracy, Most Trigger Happy, and Most Hits
Post by: mikembm on August 22, 2007, 10:14:24 pm
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 attached


Usage:
!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 all


Bugs 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. :D


Title: Re: Accuracy, Most Trigger Happy, and Most Hits
Post by: xmRipper on August 23, 2007, 06:12:20 am
Interesting script :)
Nice work.
Title: Re: Accuracy, Most Trigger Happy, and Most Hits
Post by: miketh2005 on August 23, 2007, 03:45:29 pm
Wow ausome work
Title: Re: Accuracy, Most Trigger Happy, and Most Hits
Post by: DorkeyDear on August 25, 2007, 09:53:51 am
He told me about this, which gave me the idea to make my own custom event OnPlayerShoot, which worked out fairly well, except was buggy and impossible to unbuggy it, as far as I know.

Good job though on this script. I haven't tested it but if {SS} servers ever come back, I might put this on them. :)
Title: Re: Accuracy, Most Trigger Happy, and Most Hits
Post by: boomhowza on August 27, 2007, 12:12:24 am
Awesome, this will be good for my clan server :p
Title: Re: Accuracy, Most Trigger Happy, and Most Hits
Post by: Flacid Assassin on August 27, 2007, 02:26:24 am
how do i add it to my server?