open.mp forum
[Library] Calculate accuracy of individual shotgun shots - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
---- Forum: Libraries (https://forum.open.mp/forumdisplay.php?fid=31)
---- Thread: [Library] Calculate accuracy of individual shotgun shots (/showthread.php?tid=324)



Calculate accuracy of individual shotgun shots - Markski - 2019-04-17

Very simple library based on damage measurement, all it does is calculate how many pellets of a shotgun shot hit the player, and returns the amount of pellets that hit or the percentage, depending on parameters. Might be useful for accuracy measurements, and maybe you can implement some interesting tools if coupled with distance measurement and logging..

Consists of only two functions, one for Normal or Sawnoff shotgun and one for Combat shotgun. The functions should be called from within your OnPlayerGiveDamage, if the correct weaponid hits.

Configuration

None required.

Installation

Just #include the file into your script.

Download


RE: Calculate accuracy of individual shotgun shots - Salesman - 2019-04-17

Should be usefull for somethings, nice addition!


RE: Calculate accuracy of individual shotgun shots - BigETI - 2019-04-18

Make a sampctl package out of that, please.


RE: Calculate accuracy of individual shotgun shots - Markski - 2019-04-18

(2019-04-18, 10:57 AM)BigETI Wrote: Make a sampctl package out of that, please.



Sorry, I do not use sampctl as it is not practical with my current development practices. It's just a single drop-in include file with no configuration anyways.


RE: Calculate accuracy of individual shotgun shots - kristo - 2019-04-19

(2019-04-18, 11:55 AM)Markski Wrote:
(2019-04-18, 10:57 AM)BigETI Wrote: Make a sampctl package out of that, please.

Sorry, I do not use sampctl as it is not practical with my current development practices. It's just a single drop-in include file with no configuration anyways.

Could you at least make it a git repository so it could be downloaded with sampctl? Single-file libraries don't technically need a pawn.json file, but it's a good practice to have one anyway. Someone else could add it if you don't use it yourself.


RE: Calculate accuracy of individual shotgun shots - RogueDrifter - 2019-04-20

You're a genius, i love this