Hitmarker + Damage Stats

Release your plugins here!
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Hitmarker + Damage Stats

Postby stonedegg » Fri Sep 12, 2014 5:42 pm

This plugin is a revision of my Hitmarker plugin I made for eventscripts some time ago.


What it does:
When a player hurts or blinds another player, a hitmarker will be shown at his crosshair (Call of Duty style).
Furthermore it shows every player their damage stats at the end of the round (how much damage dealt and taken and to/by whom).

Players can change their settings individually by typing !settings.


Screenshots:
2.jpg
2.jpg



Download:
Attachments
hitmarker.zip
(11.46 KiB) Downloaded 658 times
1.jpg
User avatar
Ayuto
Project Leader
Posts: 2197
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Sep 12, 2014 8:41 pm

Well done! Though, I have a few suggestions.

1. You don't need to care about making materials downloadable. SP will take care of it, if you just do this.

Syntax: Select all

dl = Downloadables()
dl.add("materials/overlays/hitmarker/hitmarkerv2.vmt")
dl.add("materials/overlays/hitmarker/hitmarkerv2.vtf")
The variable "dl" must exist as long as the script is loaded. So, the easiest option is to put it directly at the global scope.

2. This callback is redundant.

Syntax: Select all

def damage_callback(menu, index, option):
menu.close(index)
The menu will automatically close if you have selected something. Closing it again has no effect.

3. If you use the SayCommand decorator, SP will take care of registering/unregistering the say command.

Syntax: Select all

@SayCommand('!settings')
def settingsCommand(playerinfo, teamonly, command):
# ...
User avatar
satoon101
Project Leader
Posts: 2699
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sat Sep 13, 2014 1:13 am

Awesome! I am also working on a damage stats plugin, a rewrite of my ES victim_stats script:
https://github.com/satoon101/VictimStats

To clarify the Downloadables points Ayuto made, if you create the Downloadables instance in the global scope, when you unload the script, the strings are removed from the main downloadable list. The stringtable itself will still contain the values until map change. Speaking of map change, once you add values to your Downloadables set, they are automatically added to the downloadables stringtable then and every map change until your script is unloaded (or removes them from its set).

As far as user settings, as mentioned a bit in another thread, this is already mostly implemented as its own package. I haven't finished its wiki page, but did start it a few days ago:
http://wiki.sourcepython.com/index.php/settings.player
Image
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Sat Sep 13, 2014 7:30 pm

Thanks! :)
I will update the script soon with your suggestions.

@satoon, I know about the settings module, tho I don't know quite yet how to use it. An example script with an implementation would be nice. ;)
User avatar
satoon101
Project Leader
Posts: 2699
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Sep 17, 2014 3:56 pm

In relation to the settings package, I finally got the string settings working just fine, but still need to work on adding menus for the integer/float settings (and possibly add in a bool setting). I will work on testing the current master branch on Linux and CS:GO tonight and hopefully post a new release, if all goes well. As for a working example script, you might take a look at my victim_stats plugin:
https://github.com/satoon101/VictimStats

Only chat messages are working in it, currently, but the user settings do work.

My most_damage plugin has user settings, too, but I haven't tested it since I made some recent changes.
https://github.com/satoon101/MostDamage
Image

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 3 guests