freefiles

Untitled

Mar 15th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * DoD XtraLog
  3. *
  4. * Original https://pastebin.com/F06u8PCe
  5. * Adds messaging and log events for alt weapon position kills so
  6. * stats packages can track and award them. Both psychostats and HLStatsXCE
  7. * can track these events and use for awards/bonuses.
  8. *
  9. * IE:
  10. * Single shot on the support class..
  11. * IronSight for the rifles.
  12. * "Rambo" for the mg class.
  13. * NoScope and Noscope headshots
  14. *
  15. * Kudos:
  16. * Tsunami for the pm secks. <3
  17. * psychonic for being hooker #1 <3
  18. *
  19. */
  20.  
  21. #include <sourcemod>
  22. #include <sdktools>
  23. #define PLUGIN_VERSION "1.5"
  24.  
  25. new Handle:g_Cvar_XlogNS
  26. new Handle:g_Cvar_XlogHS
  27. new Handle:g_Cvar_XlogMG
  28. new Handle:g_Cvar_XlogSupport
  29. new Handle:g_Cvar_XlogRifle
  30.  
  31. public Plugin:myinfo =
  32. {
  33. name = "DoD Xtralog",
  34. author = "Mosalar",
  35. description = "Extra weapon logging info",
  36. version = PLUGIN_VERSION,
  37. url = "http://www.budznetwork.com"
  38. }
  39.  
  40. public OnPluginStart()
  41. {
  42. CreateConVar("sm_dod_xlog_version", PLUGIN_VERSION, "Extra weapon logging info version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY)
  43. g_Cvar_XlogNS = CreateConVar("sm_dod_xlog_ns", "1", "NoSocpe messages", FCVAR_PLUGIN)
  44. g_Cvar_XlogHS = CreateConVar("sm_dod_xlog_hs", "1", "NoSocpe HeadShot messages", FCVAR_PLUGIN)
  45. g_Cvar_XlogMG = CreateConVar("sm_dod_xlog_mg", "1", "MG Messages", FCVAR_PLUGIN)
  46. g_Cvar_XlogSupport = CreateConVar("sm_dod_xlog_support", "1", "Support Messages", FCVAR_PLUGIN)
  47. g_Cvar_XlogRifle = CreateConVar("sm_dod_xlog_rifle", "1", "Ironsight Messages", FCVAR_PLUGIN)
  48.  
  49.  
  50. HookEvent("dod_stats_player_damage", PlayerDamageEvent)
  51.  
  52. AutoExecConfig()
  53. }
  54.  
  55. public PlayerDamageEvent(Handle:event, const String:name[], bool:dontBroadcast)
  56. {
  57. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
  58. new client = GetClientOfUserId(GetEventInt(event, "victim"))
  59. if (attacker == 0 || !IsClientInGame(attacker) || !IsPlayerAlive(attacker)) {
  60. return
  61. }
  62. new String:auth[33]
  63. new String:attacker_name[65]
  64. new String:tname[33]
  65. new String:wname[65]
  66. new weapon_pos = GetEventInt(event, "weapon")
  67. new hitgroup = GetEventInt(event, "hitgroup")
  68. new userid = GetClientUserId(attacker)
  69. //decl String:color[10]; Format(color, sizeof(color), "%s", GetClientTeam(attacker) == 2 ? "\x074D7942" : "\x07FF4040")
  70. GetClientName(attacker, attacker_name, sizeof(attacker_name))
  71. GetClientAuthString(attacker, auth, sizeof(auth))
  72. GetTeamName(GetClientTeam(attacker), tname, sizeof(tname))
  73. GetClientWeapon(attacker, wname, sizeof(wname))
  74.  
  75. if (client != 0) {
  76.  
  77. switch (weapon_pos) {
  78.  
  79. case 9,10: {
  80. if (GetClientHealth(client) < 1) {
  81.  
  82. if (hitgroup == 1) {
  83. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  84. return
  85. }
  86. if (GetConVarInt(g_Cvar_XlogHS) == 1) {
  87. PrintToChatAll("\x01[VvV] \x04%s сделал хэдшот без оптики!", attacker_name)
  88. }
  89. }
  90. else {
  91. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  92. return
  93. }
  94. if (GetConVarInt(g_Cvar_XlogNS) == 1) {
  95. PrintToChatAll("\x01[VvV] \x04%s убил без оптики!", attacker_name)
  96. }
  97. }
  98. LogToGame("\"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  99. }
  100. }
  101. case 35,36: {
  102. if (GetClientHealth(client) < 1) {
  103.  
  104. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  105. return
  106. }
  107. if (GetConVarInt(g_Cvar_XlogMG) == 1) {
  108. PrintToChatAll("\x01[VvV] \x04%s убил с неустановленного пулемёта!", attacker_name)
  109. }
  110. LogToGame("\"%s<%d><%s><%s>\" triggered \"rambo\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  111. }
  112. }
  113. case 31,32: {
  114. if (GetClientHealth(client) < 1) {
  115.  
  116. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  117. return
  118. }
  119. if (GetConVarInt(g_Cvar_XlogRifle) == 1) {
  120. PrintToChatAll("\x01[VvV] \x04%s убил прицельно из винтовки!", attacker_name)
  121. }
  122. LogToGame("\"%s<%d><%s><%s>\" triggered \"ironsight\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  123. }
  124. }
  125. case 37,38: {
  126. if (GetClientHealth(client) < 1) {
  127.  
  128. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  129. return
  130. }
  131. if (GetConVarInt(g_Cvar_XlogSupport) == 1) {
  132. PrintToChatAll("\x01[VvV] \x04%s убил одиночным выстрелом!", attacker_name)
  133. }
  134. LogToGame("\"%s<%d><%s><%s>\" triggered \"singleshot\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  135. }
  136. }
  137. }
  138. }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment