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:
Download:
Hitmarker + Damage Stats
Hitmarker + Damage Stats
- Attachments
-
- hitmarker.zip
- (11.46 KiB) Downloaded 658 times
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.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.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.
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")
2. This callback is redundant.
Syntax: Select all
def damage_callback(menu, index, option):
menu.close(index)
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):
# ...
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
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
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
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
Who is online
Users browsing this forum: No registered users and 3 guests