View Single Post
Author Message
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-10-2011 , 10:27   [Any (CSS/GO/DODS+others)] Kill Assist
Reply With Quote #1

Kill Assist

v. 1.6.0

Introduction :

Ever think it was unfair that someone else finish someone you damaged and were about to kill ? Team RTS games (HoN, DotA, LoL) have a system that give gold to people that helped get a kill. Why should it be different in Counter-Strike (or other mods i.e. DoD:S) ? That's where this plugin come handy.


Features :
  • Gives money, points and/or mvp stars for assisting a teamate on a kill. Note that mvp stars will only work with CSS and the money will only work in CSS/CSGO.
  • Allow to give fractional frags (i.e. 2 assists --> 1 frag). (New as of 1.4.4; wtf I thought I did it before :$)
  • The assists can be logged, and therefore be parsed for stats usage (see micazoid's post).

Known bugs :
  • Not any at the moment.

CVars :
  • killassistversion: Gives version -_-'
  • kassist : If kill assist is enabled. 0 = plugin disabled. 1 = enabled (Default).
  • kassist_minDmg : Minimum damage required to assist a kill (Min 1, Def. 35). CSGO users you may want to see kassist_useInGameAssists.
  • kassist_killValue : Bonus points given to a killer (is added to the default of 1 when killing someone). Integer. Default 0 (disabled).
  • kassist_assistValue : Bonus points given to an assister. Real. Default 0.0 (disabled).
  • kassist_rankMeValue : RankMe points given to an assister. Integer. Default 0 (disabled). Only use other values if you have RankMe.
  • kassist_verbose : The default value of the verbose cookie. Tell players when they assist someone. 1=Yes (always), 2=Yes (when dead, def.).
  • kassist_verbose_cookie : If verbose cookies are used. 0=No, 1=Yes (Def.), 2=Yes (remove the 'always' option).
  • kassist_log : Write in logs when there is an assist. 1=Yes (basic, short, assister only), 2=Yes (advanced, short, assister, killer and victim), 3=Yes (basic, long, assister only), 4=Yes (advanced, long, assister, killer and victim). Default 0 (disabled). 3/4 may probably be needed by your stat-tracking tool.

CVars (CS:S specific) (all related to cash/mvp-giving in some way) :
  • kassist_cash : Kill assist cash awarded to assisters. Default 150.
  • kassist_split : If kill assist cash is split amongst assisters. Yes = 1 (Default). If set to 0, every assister will get the "kassist_cash" value.
  • kassist_enfMax : Prevent values from a cash kill to get over the $16000 limit. Without it at roundstart it will be reset to $16000. 1=Yes, Def. 1.
  • kassist_useMVPStars : Override MVPs (Stars) system to show assists ? 1=Yes (SDKHooks), 2=Yes (Dr!fter's method; faster but need 1.5.0 snapshots). Def. 1.

CVars (CS:GO specific) (all related to cash-giving / assist detection) :
  • kassist_cashType : An assist reward amount is : 1= relative to the amount the killer receive (in %). 0= a fixed amount (in $). Def. 1.
  • kassist_cash : The relative (fraction) or fixed ($) amount assisters get from a kill, depending on ConVar kassist_cashType. Default 50% (0.5) of killer cash.
  • kassist_split : If kill assist cash is split amongst assisters. Yes = 1 (Default). If set to 0, every assister will get the "kassist_cash" value.
  • kassist_enfMax : Prevent values from a cash kill to get over the mp_maxmoney limit. 1=Yes, Def. 1.
  • kassist_useInGameAssists : Use in-game CSGO assist system (instead of replicating something similar). This means cs_AssistDamageThreshold is used instead of kassist_minDmg. 0=No. 1=Yes. Def. 1.
  • kassist_useInGameThreshold : If kassist_useInGameAssists = 0, use cs_AssistDamageThreshold used by CSGO instead of kassist_minDmg ? 0=No (Def.). 1=Yes.

--------------

Any suggestions/comments on the code or the plugin are welcomed and appreciated.

Changelog :
Spoiler
  • 1.4.0 (12-03-2012)
    • Added possibility to log to server logs the assists (can be used by stats tracking tools). See ConVar "kassist_log". Requested by micazoid.
    • Added possibility for plugins' developpers to react to a kill assist. See the note below.
  • 1.4.1 Added Dr!fter's "CS_SetMVPCount" method handling for the incoming SM update (should be slightly faster). If you are on an older version of SourceMod that does not support CS_SetMvpCount it will fall back to use the SDKHooks method.
    (07-06-2012)
  • 1.4.2 Fixed bug introduced in 1.4.1 for DoD:S. Thanks to micazoid for reporting.
  • 1.4.3 (not posted in first post) Improved logging info. See micazoid's post on how-to consider Kill Assists with HLX : CE. Also see ConVar "kassist_log" for its new values possible. (04-09-2012)
  • 1.4.3b Release of 1.4.3 with a small bug fix (too small steamId buffer). Thanks to micazoid for the help/testing. (22-09-2012)
  • 1.4.3c Fixed my fail-update from 1.4.3b :$. (23-09-2012)
  • Added german translation. Thanks to micazoid. (24-09-2012)
  • 1.4.4 Added the possibility to give fractional frags (i.e. "kassist_assistValue 0.5"). Requested by musosoft. (13-10-2012)
  • 1.5.0 (02-11-2012)
    • Added support for Rankme. See ConVar kassist_rankMeValue.
    • If you don't have RankMe when loading the plugin, the plugin will still work.
    • Removed FCVAR_NOTIFY from non-version ConVar.
    • Removed FCVAR_REPLICATED from version ConVar.
    • Made the forward OnAssistedKill available in default compilation (didn't want to pollute Forwards container at that time; now I realize its dumb...).
  • Added Slovak and Czech translations. Thanks to musosoft. (26-09-2013)
  • Added Russian translation. Thanks to Allower. Sorry for the delay :$. (02-10-2014)
  • 1.6.0 (22-05-2015)
    • Added CSGO support. See kassist_cashType, kassist_cash, kassist_useInGameAssists and kassist_useInGameThreshold.
    • Added clientprefs support. This allow clients to choose themselves when they want to see that they assisted someone on a kill (in chat).
    • Removed the game restriction (it should load and work in other games; i.e. when giving frags; as I'm SDKHooking the damage instead of using player_hurt events).
    • kassist_verbose changed slightly to fit clientprefs.

Todo list :
  • Nothing

Credits :
  • Kill assist from Hunter-Digital for 1.6 (http://forums.alliedmods.net/showthread.php?p=817621). I'm currently trying to change name so we can see assisters with the same concept that he's using (renaming). I'm also trying to port his idea.seems impossible =( (race condition everywhere)
  • thetwistedpanda for his code review and various coding information (helped for 1.0.1).
  • siangc for his awesome testing & reporting bugs (1.0.2)
  • kar0t for help with DoD:S testing (1.2.0)
  • Dog for DoD:S bots (for testing; 1.2.0)
  • klausenbusk for "m_iMVPs" offsets (didn't know it before today; 1.3.0)
  • psychonic for approving.
  • micazoid for suggesting a logging feature (1.4.0)
  • Dr!fter for direct memory access for MVP stars (1.4.1)
  • micazoid for reporting bug under DoD:S (1.4.1 to 1.4.2) and helping with implementation under HLX:CE (1.4.2 to 1.4.3)
  • micazoid for German translation.
  • Allower for the Russian.

Notes :
  • Don't forget to download the phrases (put in "translations" folder).
  • killassist.inc isn't needed for the default compilation.
  • RankMe's .inc is needed to compile.
  • To allow this plugin to communicate to other plugins when someone assist in a kill, uncomment the "//#define DEV_INTERFACE" line in my plugin, then recompile it with killassist.inc in your include folder. You can then use the forward defined in the .inc file. "killassist_dev_sample.sp" gives an example of how to react to an assist. This might be needed in someone's future plugin(s).
  • See micazoid's post on how-to consider Kill Assists with HLX : CE.
  • In CSGO, this plugin does not modify the assist shown on the upper-right corner (as it is limited to one player anyway and determined with the damage & cs_AssistDamageThreshold)
  • Pre 1.6.0 : 298.sp, 343.smx, 766.txt
Attached Files
File Type: sp Get Plugin or Get Source (killassist_dev_sample.sp - 1179 views - 770 Bytes)
File Type: inc killassist.inc (561 Bytes, 1458 views)
File Type: sp Get Plugin or Get Source (killassist.sp - 950 views - 30.4 KB)
File Type: txt killassist.phrases.txt (1.4 KB, 1279 views)
File Type: smx killassist.smx (17.3 KB, 1166 views)

Last edited by RedSword; 05-22-2015 at 11:05. Reason: 1.6.0
RedSword is offline