Advertisement
freefiles

Untitled

Feb 28th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.90 KB | None | 0 0
  1. /*
  2. * DoD XtraLog
  3. *
  4. * Adds messaging and log events for alt weapon position kills so
  5. * stats packages can track and award them. Both psychostats and HLStatsXCE
  6. * can track these events and use for awards/bonuses.
  7. *
  8. * IE:
  9. * Single shot on the support class..
  10. * IronSight for the rifles.
  11. * "Rambo" for the mg class.
  12. * NoScope and Noscope headshots
  13. *
  14. * Kudos:
  15. * Tsunami for the pm secks. <3
  16. * psychonic for being hooker #1 <3
  17. *
  18. */
  19.  
  20. #include <sourcemod>
  21. #include <sdktools>
  22. #include <morecolors>
  23. #define PLUGIN_VERSION "1.35multikill"
  24.  
  25. // MultiKill
  26.  
  27. new Handle:g_taskCountdown[MAXPLAYERS+1] = INVALID_HANDLE
  28. new Handle:g_taskClean[MAXPLAYERS+1] = INVALID_HANDLE
  29. new g_killCount[MAXPLAYERS+1] = 0
  30. new g_iMaxClients = 0
  31.  
  32. new Handle:_atCleanTimer[MAXPLAYERS+1] = INVALID_HANDLE
  33. new Handle:_hTimerLength;
  34. new Float:_dTimerLength;
  35. new Handle:_hWinnerTimerLength;
  36. new Float:_dWinnerTimerLength;
  37. new _iMaxKillStreak;
  38. new _iMultiKillStreak;
  39. new _aiKillStreak[MAXPLAYERS+1];
  40. new _abClientDead[MAXPLAYERS+1];
  41. new bool:StopChain
  42. //new Handle:g_Cvar_XlogCountViewInfoPlayersOverlays (0=off,1=attacker,2=victim,3=all attacker and victim)
  43. //new Handle:g_Cvar_XlogViewInfoPlayersTextChat (0=off,1=attacker,2=victim,3=all attacker and victim)
  44. new Handle:g_Cvar_XlogNS
  45. new Handle:g_Cvar_XlogHS
  46. new Handle:g_Cvar_XlogMG
  47. new Handle:g_Cvar_XlogDetoNade
  48. new Handle:g_Cvar_XlogMeelee
  49. new Handle:g_Cvar_XlogPunch
  50. new Handle:g_Cvar_XlogSupport
  51. new Handle:g_Cvar_XlogRifle
  52. new Handle:g_Cvar_XlogBazooka
  53. new Handle:g_Cvar_XlogGrenade
  54. new Handle:g_Cvar_XlogPistol
  55. new Handle:g_Cvar_XlogSuicide
  56. new Handle:g_Cvar_XlogTeamKiller
  57. new Handle:g_Cvar_XlogWinner
  58. new Handle:g_Cvar_ViewChatText
  59. new Handle:g_Cvar_ViewOverlays
  60. new Handle:g_Cvar_XlogLogs
  61. new Handle:g_hKillOverlayEnabled
  62. new Handle:g_hMultiKillOverlayEnabled
  63.  
  64.  
  65. new Handle:g_hMeeleeMessOverlay
  66. new Handle:g_hTAGMess
  67. new Handle:g_hDetonadeMessOverlay
  68. new Handle:g_hNoscopeOverlay
  69. new Handle:g_hHeadShotOverlay
  70. new Handle:g_hMGMessOverlay
  71. new Handle:g_hSupportOverlay
  72. new Handle:g_hBazookaOverlay
  73. new Handle:g_hIronsigntOverlay
  74. new Handle:g_hPunchOverlay
  75. new Handle:g_hGrenadeOverlay
  76. new Handle:g_hAlliedWinsOverlay
  77. new Handle:g_hAxisWinsOverlay
  78. new Handle:g_hKillOverlayNaming
  79. new Handle:g_hMaxKillStreak
  80. new Handle:g_hPathOverLay
  81. new Handle:g_hPistolOverlay
  82. new Handle:g_hSuicideOverlay
  83. new Handle:g_hTeamKillerOverlay
  84. new Handle:g_hMultiKillOverlay
  85. new Handle:g_hMultiKillStreak
  86.  
  87. new String:_sNoscopeOverlay[32]
  88. new String:_sHeadShotOverlay[32]
  89. new String:_sMGMessOverlay[32]
  90. new String:_sSupportOverlay[32]
  91. new String:_sBazookaOverlay[32]
  92. new String:_sPunchOverlay[32]
  93. new String:_sIronsigntOverlay[32]
  94. new String:_sMeeleeOverlay[32]
  95. new String:_sDetoNadeMessOverlay[32]
  96. new String:_sGrenadeOverlay[32]
  97. new String:_sAlliedWinsOverlay[32]
  98. new String:_sAxisWinsOverlay[32]
  99. new String:_sKillOverlayNaming[32]
  100. new String:_sPistolOverlay[32]
  101. new String:_sSuicideOverlay[32]
  102. new String:_sTeamKillerOverlay[32]
  103. new String:_sMultiKillOverlay[32]
  104.  
  105.  
  106.  
  107. // Добавить возможность вкл и выкл на стороне клиента картинок
  108. //
  109. //
  110. //
  111. //
  112. //
  113.  
  114. // sPathOverlays
  115. //g_Cvar_XlogTAG,g_hTAGOverlay
  116. // GetConVarString(g_hTAGOverlay, _sTAGText, sizeof(_sTAGText));
  117. // if (GetConVarInt(g_Cvar_XlogTAG) == 1) CPrintToChatAll("{lightgreen}%s {olive} %t ","meelee", tag, attacker_name)
  118.  
  119. // CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name)
  120. //
  121. // ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverlays,sOverLay);
  122. //
  123. // added client_name in CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name,client_name)
  124. //
  125. // winner team overlays
  126. // ON-OFF Overlays the sm_tockillmess_show ==public Action:ShowKillMessage(args)
  127. // sPathOverlays
  128. //g_Cvar_XlogTAG,g_hTAGOverlay
  129. // GetConVarString(g_hTAGOverlay, _sTAGText, sizeof(_sTAGText));
  130. // if (GetConVarInt(g_Cvar_XlogTAG) == 1) CPrintToChatAll("{lightgreen}%s {olive} %t ","meelee", tag, attacker_name)
  131. //
  132. // CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name)
  133. //
  134. // ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverlays,sOverLay);
  135. //
  136. // added client_name in CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name,client_name)
  137. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  138. // if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
  139. // CPrintToChatAll("%t","meelee",_sTAGOverlay, attacker_name,client_name)
  140. // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
  141. // if (GetConVarInt(g_Cvar_VictimOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
  142. // }
  143. // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  144. //
  145. //
  146. // winner team overlays
  147. // ON-OFF Overlays the sm_toskillmess_show ==public Action:ShowKillMessage(args)
  148. // Print client_name for text chat
  149. //
  150. // on off view overlyas teams
  151. // через массив выод nbgf Spray[weapon_pos "punch",meelee,meelee, bnl] OverlaysWeapons["",""]
  152. // new String:WpnMelee[4][] = { "", "", "weapon_amerknife", "weapon_spade" }
  153.  
  154. // показывать всем или выборочно . но учесть и киллнэмэйнинг
  155. // GetClientName(attacker, attacker_name, sizeof(attacker_name))
  156. // GetClientName(client, client_name, sizeof(client_name))
  157. //
  158. // new String:WeaponPos[40][] = { "", "_sMeeleeOverlay", "_sMeeleeOverlay", "_sPistolOverlay", "_sPistolOverlay" }
  159. // ServerCommand("sm_tockillmess_show %s %s",sAttackerID,WeaponPos[weapon_pos]);
  160. // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
  161. // if (GetConVarInt(g_Cvar_VictimOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
  162. // text see attacker & victim name and overlays only attacker
  163. // 0=off 1=for all 2=on attacker 3=on victim
  164. // if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","pistol",_sTAGOverlay, attacker_name,client_name);
  165. //
  166. // if (GetConVarInt(g_Cvar_VictimOverlays) == 2 || GetConVarInt(g_Cvar_VictimOverlays) == 3) CPrintToChat("%t","pistol",_sTAGOverlay, attacker_name,client_name);
  167. // g_Cvar_ViewChatText
  168. // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1 || GetConVarInt(g_Cvar_VictimOverlays) == 2) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
  169. // if (GetConVarInt(g_Cvar_VictimOverlays) == 1 || GetConVarInt(g_Cvar_VictimOverlays) == 3) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
  170. // strlen(string)
  171. //g_hKillOverlayEnabled
  172. // if (GetConVarInt(g_hKillOverlayEnabled) == 1))
  173. // sm_toc_enabled
  174. // sm_toc_bs_length
  175. // sm_toc_bs_path
  176. // sm_toc_bs_tag
  177. // sm_toc_bs_enabled_weapon=xxx
  178. // sm_toc_bs_weapon_xxxxx
  179. // sm_toc_bs_winteam_enabled
  180. // sm_toc_bs_winteam_allied
  181. // sm_toc_bs_winteam_axis
  182. // sm_toc_bs_winteam_killnaming
  183. // sm_toc_bs_winteam_maxkillstreak
  184. // BuildPath(Path_SM, logfile, sizeof(logfile), "logs/mylogfile.txt"); LogToFile(logfile, "My log: ...");
  185. // \"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname
  186. //
  187. // BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt"); LogToFile(logfile, "My log: \"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  188. //GetEngineVersion
  189. //
  190.  
  191. public Plugin:myinfo =
  192. {
  193. name = "DoD Xtralog plus Overlays for servers(morecolors) fix 1.35",
  194. author = "Siang Chun & Black Haze & Xeon & Mosalar & T@HK",
  195. description = "Extra weapon logging info plus Overlays for servers(morecolors)",
  196. version = PLUGIN_VERSION,
  197. url = "http://www.budznetwork.com,http://dayofdefeat.ucoz.net/"
  198. }
  199.  
  200. public OnPluginStart()
  201. {
  202. CreateConVar("sm_bs_toc_version", PLUGIN_VERSION, "Extra weapon logging info plus overlays version")
  203. _hTimerLength = CreateConVar("sm_toc_overlays_view_length", "3.0", "Время показа картинки (в сек.)");
  204. _dTimerLength = GetConVarFloat(_hTimerLength);
  205. _hWinnerTimerLength = CreateConVar("sm_toc_winner_overlays_view_length", "7.0", "Время показа картинки во время победы из команд (в сек.)");
  206. _dWinnerTimerLength = GetConVarFloat(_hWinnerTimerLength);
  207.  
  208. g_Cvar_ViewChatText = CreateConVar("sm_toc_view_textchat", "1", "Показ в текстовом чате инофрмации от убийствах (0=выкл,1=всем (кто убил , кого убили),2=кого убили,3=кто убил)")
  209. g_Cvar_ViewOverlays = CreateConVar("sm_toc_view_overlays", "1", "Показ картинки(оверлея) на оружие - кто убил(attacker) или кого убили(victim) 0=всем,1=кто убил,2=жертве-кого убили")
  210. // g_Cvar_VictimOverlays = CreateConVar("sm_dod_xlog_overlays_view", "1", "Overlays Victim ON/OFF(1/0)")
  211. // g_Cvar_AttackerOverlays = CreateConVar("sm_dod_xlog_overlays_view", "1", "Overlays Attacker ON/OFF(1/0)")
  212. g_Cvar_XlogLogs = CreateConVar("sm_toc_logs_enables", "0", "Включить запись лога в файл об убийствах ../logs")
  213. g_hTAGMess = CreateConVar("sm_toc_name_tag", "[TOC XLog Overlays]", "Тэг перед текстом")
  214. // g_Cvar_XlogPathOverlays = CreateConVar("sm_dod_xlog_pathoverlays", "1", "Meelee Messages")
  215. g_hPathOverLay = CreateConVar("sm_toc_name_path", "toc_overlays", "Путь для папки с Материалами/Overlays - materials/имя вашей папки")
  216. g_Cvar_XlogMeelee = CreateConVar("sm_toc_bs_meelee_enabled", "1", "Meelee Messages")
  217. g_hMeeleeMessOverlay = CreateConVar("sm_toc_bs_meelee_overlays", "meelee", "Материал (убийство с ножа/лопатой)")
  218. g_Cvar_XlogDetoNade = CreateConVar("sm_toc_bs_detonade_enabled", "1", "DetoNade Messages")
  219. g_hDetonadeMessOverlay = CreateConVar("sm_toc_bs_detonade_overlays", "deto_naded", "Материал (убийство с винтовочных гранат)")
  220. g_Cvar_XlogNS = CreateConVar("sm_toc_bs_ns_enabled", "1", "NoScope messages")
  221. g_hNoscopeOverlay = CreateConVar("sm_toc_bs_ns_overlays", "unscope", "Материал (убийство без прицела)")
  222. g_Cvar_XlogHS = CreateConVar("sm_toc_bs_hs_enabled", "1", "NoScope HeadShot messages")
  223. g_hHeadShotOverlay = CreateConVar("sm_toc_bs_hs_overlays", "headshot", "Материал (убийство в голову без прицела)")
  224. g_Cvar_XlogMG = CreateConVar("sm_toc_bs_mg_enabled", "1", "MG Messages")
  225. g_hMGMessOverlay = CreateConVar("sm_toc_bs_mg_overlays", "mgkill", "Материал (убийство с рук MG)")
  226. g_Cvar_XlogSupport = CreateConVar("sm_toc_bs_support_enabled", "1", "Support Messages")
  227. g_hSupportOverlay = CreateConVar("sm_toc_bs_support_overlays", "support", "Материал (убийство с поддержки одиночным выстрелом)")
  228. g_Cvar_XlogPunch = CreateConVar("sm_toc_bs_punch_enabled", "1", "Punch Messages")
  229. g_hPunchOverlay = CreateConVar("sm_toc_bs_punch_overlays", "punch", "Материал (убийство кулаком)")
  230. g_Cvar_XlogRifle = CreateConVar("sm_toc_bs_rifle_enabled", "1", "Ironsight Messages")
  231. g_hIronsigntOverlay = CreateConVar("sm_toc_bs_rifle_overlays", "ironsight", "Материал (убийство с прицельно из винтовки)")
  232. g_Cvar_XlogGrenade = CreateConVar("sm_toc_bs_grenade_enabled", "1", "Grenade Messages")
  233. g_hGrenadeOverlay = CreateConVar("sm_toc_bs_grenade_overlays", "toc_grenade", "Материал (убийство с гранаты)");
  234. g_Cvar_XlogBazooka = CreateConVar("sm_toc_bs_bazooka_enabled", "1", "Rocket Messages", FCVAR_PLUGIN)
  235. g_hBazookaOverlay = CreateConVar("sm_toc_bs_bazooka_overlays", "rocket", "Материал (убийство из базуки)")
  236. g_Cvar_XlogPistol = CreateConVar("sm_toc_bs_pistol_enabled", "1", "Pistol Messages", FCVAR_PLUGIN)
  237. g_hPistolOverlay = CreateConVar("sm_toc_bs_pistol_overlays", "pistol", "Материал (убийство c пистолета)")
  238. g_Cvar_XlogSuicide = CreateConVar("sm_toc_bs_suicide_enabled", "1", "Suicide Messages", FCVAR_PLUGIN)
  239. g_hSuicideOverlay = CreateConVar("sm_toc_bs_suicide_overlays", "suicide", "Материал на самоубийство ")
  240. g_Cvar_XlogTeamKiller = CreateConVar("sm_toc_bs_teamkiller_enabled", "1", "Team Killer Messages", FCVAR_PLUGIN)
  241. g_hTeamKillerOverlay = CreateConVar("sm_toc_bs_teamkiller_overlays", "teamkiller", "Материал на убийство своих по команде")
  242. g_Cvar_XlogWinner = CreateConVar("sm_toc_winteam_all_enabled", "0", "Winner Teams Overlays", FCVAR_PLUGIN)
  243. g_hAlliedWinsOverlay = CreateConVar("sm_toc_winteam_allied", "toc_allied_wins", "Материал (Американцы одержали победу)");
  244. g_hAxisWinsOverlay = CreateConVar("sm_toc_winteam_axis", "toc_axis_wins", "Материал (Немцы одержали победу)");
  245. g_hKillOverlayEnabled = CreateConVar("sm_toc_killnaming_enabled", "0", "Включить показ убийств по кол-ву 0=нет/1=вкл (убийства от бота не показывается)");
  246. g_hKillOverlayNaming = CreateConVar("sm_toc_killnaming_overlay", "toc_", "Материал (Названия простого убийство под номером 1-10)");
  247. g_hMaxKillStreak = CreateConVar("sm_toc_maxkillstreak_overlay", "10", "Сколько тут ? (Сколько материалов будет подключаться для обычного убийства)");
  248. // MultiKill
  249. g_hMultiKillOverlayEnabled = CreateConVar("sm_toc_multikill_enabled", "1", "Включить показ одновременных убийств(multikill) по кол-ву 0=нет/1=вкл (убийства от бота не показывается !!????)");
  250. g_hMultiKillOverlay = CreateConVar("sm_toc_multikill_overlay", "multikill_", "Материал (Названия убийств за 1 раз(multikill) под номерами 2-5)");
  251. g_hMultiKillStreak = CreateConVar("sm_toc_multikillmax_overlay", "5", "Сколько тут ? (Сколько материалов будет подключаться для одновременных убийств 2=мин, 5=мах)", FCVAR_PLUGIN, true, 2.0, true, 5.0);
  252.  
  253. RegServerCmd("sm_tockillmess_show", ShowKillMessage);
  254. RegServerCmd("sm_tockillmess_prepare", PrepareOverlay);
  255.  
  256. HookEvent("player_death", Event_PlayerDeath);
  257. HookEvent("player_spawn", Event_PlayerSpawn);
  258. HookEvent("dod_round_win", Event_RoundEnd);
  259. HookEvent("dod_round_start", Event_RoundStart);
  260. HookEvent("dod_stats_player_damage", PlayerDamageEvent)
  261.  
  262. LoadTranslations("toc_overlays_multikill.phrases");
  263. AutoExecConfig()
  264. }
  265.  
  266. public OnMapStart()
  267. {
  268. g_iMaxClients = GetMaxClients();
  269.  
  270. if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
  271. GetConVarString(g_hMeeleeMessOverlay, _sMeeleeOverlay, sizeof(_sMeeleeOverlay));
  272. ServerCommand("sm_tockillmess_prepare %s",_sMeeleeOverlay);
  273. }
  274.  
  275. if (GetConVarInt(g_Cvar_XlogDetoNade) == 1) {
  276. GetConVarString(g_hDetonadeMessOverlay, _sDetoNadeMessOverlay, sizeof(_sDetoNadeMessOverlay));
  277. ServerCommand("sm_tockillmess_prepare %s",_sDetoNadeMessOverlay);
  278. }
  279.  
  280. if (GetConVarInt(g_Cvar_XlogNS) == 1) {
  281. GetConVarString(g_hNoscopeOverlay, _sNoscopeOverlay, sizeof(_sNoscopeOverlay));
  282. ServerCommand("sm_tockillmess_prepare %s",_sNoscopeOverlay);
  283. }
  284.  
  285. if (GetConVarInt(g_Cvar_XlogHS) == 1) {
  286. GetConVarString(g_hHeadShotOverlay, _sHeadShotOverlay, sizeof(_sHeadShotOverlay));
  287. ServerCommand("sm_tockillmess_prepare %s",_sHeadShotOverlay);
  288. }
  289.  
  290. if (GetConVarInt(g_Cvar_XlogMG) == 1) {
  291. GetConVarString(g_hMGMessOverlay, _sMGMessOverlay, sizeof(_sMGMessOverlay));
  292. ServerCommand("sm_tockillmess_prepare %s",_sMGMessOverlay);
  293. }
  294.  
  295. if (GetConVarInt(g_Cvar_XlogSupport) == 1) {
  296. GetConVarString(g_hSupportOverlay, _sSupportOverlay, sizeof(_sSupportOverlay));
  297. ServerCommand("sm_tockillmess_prepare %s",_sSupportOverlay);
  298. }
  299.  
  300. if (GetConVarInt(g_Cvar_XlogPunch) == 1) {
  301. GetConVarString(g_hPunchOverlay, _sPunchOverlay, sizeof(_sPunchOverlay));
  302. ServerCommand("sm_tockillmess_prepare %s",_sPunchOverlay);
  303. }
  304.  
  305. if (GetConVarInt(g_Cvar_XlogRifle) == 1) {
  306. GetConVarString(g_hIronsigntOverlay, _sIronsigntOverlay, sizeof(_sIronsigntOverlay));
  307. ServerCommand("sm_tockillmess_prepare %s",_sIronsigntOverlay);
  308. }
  309. if (GetConVarInt(g_Cvar_XlogGrenade) == 1) {
  310. GetConVarString(g_hGrenadeOverlay, _sGrenadeOverlay, sizeof(_sGrenadeOverlay));
  311. ServerCommand("sm_tockillmess_prepare %s",_sGrenadeOverlay);
  312. }
  313.  
  314. if (GetConVarInt(g_Cvar_XlogWinner) == 1) {
  315. GetConVarString(g_hAlliedWinsOverlay, _sAlliedWinsOverlay, sizeof(_sAlliedWinsOverlay));
  316. ServerCommand("sm_tockillmess_prepare %s",_sAlliedWinsOverlay);
  317. GetConVarString(g_hAxisWinsOverlay, _sAxisWinsOverlay, sizeof(_sAxisWinsOverlay));
  318. ServerCommand("sm_tockillmess_prepare %s",_sAxisWinsOverlay);
  319. }
  320.  
  321. if (GetConVarInt(g_Cvar_XlogBazooka) == 1) {
  322. GetConVarString(g_hBazookaOverlay, _sBazookaOverlay, sizeof(_sBazookaOverlay));
  323. ServerCommand("sm_tockillmess_prepare %s",_sBazookaOverlay)
  324. }
  325.  
  326. if (GetConVarInt(g_Cvar_XlogPistol) == 1) {
  327. GetConVarString(g_hPistolOverlay, _sPistolOverlay, sizeof(_sPistolOverlay));
  328. ServerCommand("sm_tockillmess_prepare %s",_sPistolOverlay);
  329. }
  330.  
  331. if (GetConVarInt(g_Cvar_XlogSuicide) == 1) {
  332. GetConVarString(g_hSuicideOverlay, _sSuicideOverlay, sizeof(_sSuicideOverlay));
  333. ServerCommand("sm_tockillmess_prepare %s",_sSuicideOverlay);
  334. }
  335.  
  336. if (GetConVarInt(g_Cvar_XlogTeamKiller) == 1) {
  337. GetConVarString(g_hTeamKillerOverlay, _sTeamKillerOverlay, sizeof(_sTeamKillerOverlay));
  338. ServerCommand("sm_tockillmess_prepare %s",_sTeamKillerOverlay);
  339. }
  340.  
  341. if (GetConVarInt(g_hKillOverlayEnabled) == 1) {
  342. GetConVarString(g_hKillOverlayNaming, _sKillOverlayNaming, sizeof(_sKillOverlayNaming));
  343. _iMaxKillStreak = GetConVarInt(g_hMaxKillStreak);
  344.  
  345. new iCounter;
  346. for (iCounter = 1; iCounter <= _iMaxKillStreak; iCounter++)
  347. {
  348. new String:sCounterTemp[64];
  349. IntToString(iCounter, sCounterTemp,sizeof(sCounterTemp));
  350. ServerCommand("sm_tockillmess_prepare %s%s",_sKillOverlayNaming,sCounterTemp);
  351. }
  352. }
  353.  
  354. if (GetConVarInt(g_hMultiKillOverlayEnabled) == 1) {
  355. GetConVarString(g_hMultiKillOverlay, _sMultiKillOverlay, sizeof(_sMultiKillOverlay));
  356. _iMultiKillStreak = GetConVarInt(g_hMultiKillStreak);
  357.  
  358. new iMultiCounter;
  359. for (iMultiCounter = 2; iMultiCounter <= _iMultiKillStreak; iMultiCounter++)
  360. {
  361. new String:sMultiCounterTemp[64];
  362. IntToString(iMultiCounter, sMultiCounterTemp,sizeof(sMultiCounterTemp));
  363. ServerCommand("sm_tockillmess_prepare %s%s",_sMultiKillOverlay,sMultiCounterTemp);
  364. }
  365. }
  366. }
  367.  
  368. public PlayerDamageEvent(Handle:event, const String:name[], bool:dontBroadcast)
  369. {
  370. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
  371. new client = GetClientOfUserId(GetEventInt(event, "victim"))
  372. if (attacker == 0 || !IsClientInGame(attacker) || !IsPlayerAlive(attacker) || StopChain || g_killCount[attacker] > 1) {
  373. return
  374. }
  375. new String:auth[33]
  376. new String:attacker_name[65]
  377. new String:client_name[65]
  378. new String:tname[33]
  379. new String:cname[33]
  380. new String:wname[65]
  381. new String:sAttackerID[32];
  382. new weapon_pos = GetEventInt(event, "weapon")
  383. new hitgroup = GetEventInt(event, "hitgroup")
  384. new userid = GetClientUserId(attacker)
  385. //decl String:color[10]; Format(color, sizeof(color), "%s", GetClientTeam(attacker) == 2 ? "\x074D7942" : "\x07FF4040")
  386. GetClientName(attacker, attacker_name, sizeof(attacker_name))
  387. GetClientName(client, client_name, sizeof(client_name))
  388. // GetClientAuthString(attacker, auth, sizeof(auth))
  389. GetTeamName(GetClientTeam(attacker), tname, sizeof(tname))
  390. GetTeamName(GetClientTeam(client), cname, sizeof(cname))
  391. GetClientWeapon(attacker, wname, sizeof(wname))
  392. // new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
  393. GetEventString(event, "attacker",sAttackerID, sizeof(sAttackerID))
  394.  
  395. // new victim = GetClientOfUserId(GetEventInt(event, "userid"));
  396. // new String:sVictimID[32];
  397. new String:sClientID[32];
  398. // GetEventString(event, "userid",sVictimID, sizeof(sVictimID));
  399. GetEventString(event, "userid",sClientID, sizeof(sClientID));
  400. new String:_sTAGOverlay[64];
  401. GetConVarString(g_hTAGMess, _sTAGOverlay, sizeof(_sTAGOverlay));
  402.  
  403. if(GetClientHealth(client) < 1 && attacker == client) {
  404.  
  405. if (GetConVarInt(g_Cvar_XlogSuicide) == 1) {
  406. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","suicide",_sTAGOverlay, attacker_name,client_name);
  407. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","suicide",_sTAGOverlay, attacker_name,client_name);
  408. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","suicide",_sTAGOverlay, attacker_name,client_name);
  409. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  410. {
  411. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSuicideOverlay);
  412. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSuicideOverlay);
  413. }
  414. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSuicideOverlay);
  415. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSuicideOverlay);
  416. }
  417. LogToGame("\"%s<%d><%s><%s>\" triggered \"suicide\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  418. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  419. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "%s<%d><%s><%s> triggered suicide with %s %s", attacker_name,client_name, userid, auth, tname, wname);
  420. return ;
  421. }
  422.  
  423. if (client != 0) {
  424.  
  425. if (GetClientHealth(client) < 1 && GetClientTeam(attacker) == GetClientTeam(client)) {
  426.  
  427. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  428. return
  429. }
  430. if (GetConVarInt(g_Cvar_XlogTeamKiller) == 1) {
  431. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
  432. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
  433. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
  434. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  435. {
  436. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sTeamKillerOverlay);
  437. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sTeamKillerOverlay);
  438. }
  439. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sTeamKillerOverlay);
  440. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sTeamKillerOverlay);
  441. }
  442. LogToGame("\"%s<%d><%s><%s>\" triggered \"teamkiller\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  443. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  444. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"teamkiller\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  445. return ;
  446. }
  447.  
  448. switch (weapon_pos) {
  449. case 1,2: {
  450. if (GetClientHealth(client) < 1) {
  451.  
  452. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  453. return
  454. }
  455. if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
  456. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","meelee",_sTAGOverlay, attacker_name,client_name);
  457. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","meelee",_sTAGOverlay, attacker_name,client_name);
  458. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","meelee",_sTAGOverlay, attacker_name,client_name);
  459. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  460. {
  461. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
  462. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
  463. }
  464. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
  465. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
  466. }
  467. LogToGame("\"%s<%d><%s><%s>\" triggered \"meelee\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  468. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  469. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "%s<%d><%s><%s> triggeredmeelee with %s %s", attacker_name,client_name, userid, auth, tname, wname);
  470.  
  471. }
  472. }
  473.  
  474. case 3,4: {
  475. if (GetClientHealth(client) < 1) {
  476.  
  477. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  478. return
  479. }
  480. if (GetConVarInt(g_Cvar_XlogPistol) == 1) {
  481. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","pistol",_sTAGOverlay, attacker_name,client_name);
  482. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","pistol",_sTAGOverlay, attacker_name,client_name);
  483. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","pistol",_sTAGOverlay, attacker_name,client_name);
  484. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  485. {
  486. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPistolOverlay);
  487. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPistolOverlay);
  488. }
  489. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPistolOverlay);
  490. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPistolOverlay);
  491. }
  492. LogToGame("\"%s<%d><%s><%s>\" triggered \"pistol\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  493. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  494. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"pistol\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  495. }
  496. }
  497.  
  498. case 9,10: {
  499. if (GetClientHealth(client) < 1) {
  500.  
  501. if (hitgroup == 1) {
  502. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  503. return
  504. }
  505. if (GetConVarInt(g_Cvar_XlogHS) == 1) {
  506. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","headshot",_sTAGOverlay, attacker_name,client_name);
  507. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","headshot",_sTAGOverlay, attacker_name,client_name);
  508. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","headshot",_sTAGOverlay, attacker_name,client_name);
  509. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  510. {
  511. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sHeadShotOverlay);
  512. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sHeadShotOverlay);
  513. }
  514. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sHeadShotOverlay);
  515. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sHeadShotOverlay);
  516. }
  517. }
  518. else {
  519. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  520. return
  521. }
  522. if (GetConVarInt(g_Cvar_XlogNS) == 1) {
  523. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","noscope",_sTAGOverlay, attacker_name,client_name);
  524. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","noscope",_sTAGOverlay, attacker_name,client_name);
  525. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","noscope",_sTAGOverlay, attacker_name,client_name);
  526. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  527. {
  528. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sNoscopeOverlay);
  529. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sNoscopeOverlay);
  530. }
  531. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sNoscopeOverlay);
  532. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sNoscopeOverlay);
  533. }
  534. }
  535. LogToGame("\"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  536. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  537. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  538. }
  539. }
  540.  
  541. case 17,18: {
  542. if (GetClientHealth(client) < 1) {
  543.  
  544. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  545. return
  546. }
  547. if (GetConVarInt(g_Cvar_XlogBazooka) == 1) {
  548. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","bazooka",_sTAGOverlay, attacker_name,client_name);
  549. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","bazooka",_sTAGOverlay, attacker_name,client_name);
  550. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","bazooka",_sTAGOverlay, attacker_name,client_name);
  551. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  552. {
  553. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sBazookaOverlay);
  554. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sBazookaOverlay);
  555. }
  556. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sBazookaOverlay);
  557. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sBazookaOverlay);
  558. }
  559. LogToGame("\"%s<%d><%s><%s>\" triggered \"rocketman\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  560. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  561. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"rocketman\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  562. }
  563. }
  564.  
  565. case 19,20: {
  566. if (GetClientHealth(client) < 1) {
  567.  
  568. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  569. return
  570. }
  571. if (GetConVarInt(g_Cvar_XlogGrenade) == 1) {
  572. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","grenade",_sTAGOverlay, attacker_name,client_name);
  573. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","grenade",_sTAGOverlay, attacker_name,client_name);
  574. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","grenade",_sTAGOverlay, attacker_name,client_name);
  575. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  576. {
  577. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sGrenadeOverlay);
  578. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sGrenadeOverlay);
  579. }
  580. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sGrenadeOverlay);
  581. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sGrenadeOverlay);
  582. }
  583. LogToGame("\"%s<%d><%s><%s>\" triggered \"grenade\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  584. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  585. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"grenade\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  586. }
  587. }
  588.  
  589. case 25,26: {
  590. if (GetClientHealth(client) < 1) {
  591.  
  592. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  593. return
  594. }
  595. if (GetConVarInt(g_Cvar_XlogDetoNade) == 1) {
  596. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","detonade",_sTAGOverlay, attacker_name,client_name);
  597. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","detonade",_sTAGOverlay, attacker_name,client_name);
  598. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","detonade",_sTAGOverlay, attacker_name,client_name);
  599. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  600. {
  601. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sDetoNadeMessOverlay);
  602. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sDetoNadeMessOverlay);
  603. }
  604. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sDetoNadeMessOverlay);
  605. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sDetoNadeMessOverlay);
  606. }
  607. LogToGame("\"%s<%d><%s><%s>\" triggered \"detonade\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  608. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  609. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"detonade\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  610. }
  611. }
  612.  
  613. case 29,30: {
  614. if (GetClientHealth(client) < 1) {
  615.  
  616. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  617. return
  618. }
  619. if (GetConVarInt(g_Cvar_XlogPunch) == 1) {
  620. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","punch",_sTAGOverlay, attacker_name,client_name);
  621. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","punch",_sTAGOverlay, attacker_name,client_name);
  622. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","punch",_sTAGOverlay, attacker_name,client_name);
  623. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  624. {
  625. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPunchOverlay);
  626. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPunchOverlay);
  627. }
  628. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPunchOverlay);
  629. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPunchOverlay);
  630. }
  631. LogToGame("\"%s<%d><%s><%s>\" triggered \"punch\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  632. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  633. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"punch\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  634. }
  635. }
  636.  
  637. case 31,32: {
  638. if (GetClientHealth(client) < 1) {
  639.  
  640. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  641. return
  642. }
  643. if (GetConVarInt(g_Cvar_XlogRifle) == 1) {
  644. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","ironsight",_sTAGOverlay, attacker_name,client_name);
  645. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","ironsight",_sTAGOverlay, attacker_name,client_name);
  646. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","ironsight",_sTAGOverlay, attacker_name,client_name);
  647. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  648. {
  649. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sIronsigntOverlay);
  650. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sIronsigntOverlay);
  651. }
  652. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sIronsigntOverlay);
  653. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sIronsigntOverlay);
  654. }
  655. LogToGame("\"%s<%d><%s><%s>\" triggered \"ironsight\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  656. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  657. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"ironsight\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  658. }
  659. }
  660.  
  661. case 35,36: {
  662. if (GetClientHealth(client) < 1) {
  663.  
  664. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  665. return
  666. }
  667. if (GetConVarInt(g_Cvar_XlogMG) == 1) {
  668. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","rambo",_sTAGOverlay, attacker_name,client_name);
  669. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","rambo",_sTAGOverlay, attacker_name,client_name);
  670. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","rambo",_sTAGOverlay, attacker_name,client_name);
  671. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  672. {
  673. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMGMessOverlay);
  674. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMGMessOverlay);
  675. }
  676. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMGMessOverlay);
  677. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMGMessOverlay);
  678. }
  679. LogToGame("\"%s<%d><%s><%s>\" triggered \"rambo\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  680. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  681. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"rambo\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  682. }
  683. }
  684.  
  685. case 37,38: {
  686. if (GetClientHealth(client) < 1) {
  687.  
  688. if (attacker == 0 || !IsPlayerAlive(attacker)) {
  689. return
  690. }
  691. if (GetConVarInt(g_Cvar_XlogSupport) == 1) {
  692. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","singleshot",_sTAGOverlay, attacker_name,client_name);
  693. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","singleshot",_sTAGOverlay, attacker_name,client_name);
  694. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","singleshot",_sTAGOverlay, attacker_name,client_name);
  695. if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
  696. {
  697. ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSupportOverlay);
  698. ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSupportOverlay);
  699. }
  700. if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSupportOverlay);
  701. if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSupportOverlay);
  702. }
  703. LogToGame("\"%s<%d><%s><%s>\" triggered \"singleshot\" with \"%s\"", attacker_name, userid, auth, tname, wname);
  704. //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
  705. if (GetConVarInt(g_Cvar_XlogLogs) == 1) LogToFile("logs/toc_logfile.txt", "\"%s<%d><%s><%s>\" triggered \"singleshot\" with \"%s\" %s", attacker_name,client_name, userid, auth, tname, wname);
  706. }
  707. }
  708. }
  709. }
  710. }
  711.  
  712. public Action:ShowKillMessage(args)
  713. {
  714. if (args < 2)
  715. {
  716. return Plugin_Handled;
  717. }
  718.  
  719. decl String: client_id[192];
  720. GetCmdArg(1, client_id, sizeof(client_id));
  721. new client = GetClientOfUserId(StringToInt(client_id));
  722.  
  723. if(IsClientConnected(client) && !IsFakeClient(client))
  724. {
  725. decl String: sOverLay[192];
  726. GetCmdArg(2, sOverLay, sizeof(sOverLay));
  727. decl String: sPathOverLay[192];
  728. GetConVarString(g_hPathOverLay, sPathOverLay, sizeof(sPathOverLay))
  729.  
  730. if(_atCleanTimer[client] !=INVALID_HANDLE)
  731. {
  732. KillTimer(_atCleanTimer[client]);
  733. _atCleanTimer[client] =INVALID_HANDLE;
  734. }
  735.  
  736. if (StopChain)
  737. {
  738. _atCleanTimer[client] = CreateTimer(_dWinnerTimerLength,CleanTimer,client);
  739. }
  740. else
  741. {
  742. _atCleanTimer[client] = CreateTimer(_dTimerLength,CleanTimer,client);
  743. }
  744. ClearScreen(client);
  745. // PrintToChatAll("r_screenoverlay \"%s/%s.vtf\"",sPathOverLay,sOverLay);
  746. ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverLay,sOverLay);
  747. }
  748. return Plugin_Handled;
  749. }
  750.  
  751. public ClearScreen(client)
  752. {
  753. if(IsClientConnected(client) && !IsFakeClient(client))
  754. {
  755. ClientCommand(client, "r_screenoverlay \"\"");
  756. }
  757. }
  758.  
  759. public Action:CleanTimer(Handle:Timer, any:client)
  760. {
  761. _atCleanTimer[client] = INVALID_HANDLE;
  762. ClearScreen(client);
  763. }
  764.  
  765. public Action:PrepareOverlay(args)
  766. {
  767. if (args < 1)
  768. {
  769. return Plugin_Handled;
  770. }
  771.  
  772. decl String: sOverLay[192];
  773. GetCmdArg(1, sOverLay, sizeof(sOverLay));
  774. decl String: sPathOverLay[192];
  775. GetConVarString(g_hPathOverLay, sPathOverLay, sizeof(sPathOverLay))
  776.  
  777. new String:overlays_file[64];
  778. new String:overlays_dltable[64];
  779.  
  780. Format(overlays_file,sizeof(overlays_file),"%s/%s.vtf",sPathOverLay,sOverLay);
  781. PrecacheDecal(overlays_file,true);
  782. Format(overlays_dltable,sizeof(overlays_dltable),"materials/%s/%s.vtf",sPathOverLay,sOverLay);
  783. AddFileToDownloadsTable(overlays_dltable);
  784. Format(overlays_file,sizeof(overlays_file),"%s/%s.vmt",sPathOverLay,sOverLay);
  785. PrecacheDecal(overlays_file,true);
  786. Format(overlays_dltable,sizeof(overlays_dltable),"materials/%s/%s.vmt",sPathOverLay,sOverLay);
  787. AddFileToDownloadsTable(overlays_dltable);
  788.  
  789. return Plugin_Handled;
  790. }
  791.  
  792.  
  793. public OnClientPutInServer(client)
  794. {
  795. if(client>0)
  796. {
  797. _aiKillStreak[client]=0;
  798. _abClientDead[client]=false;
  799. }
  800. }
  801.  
  802. public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  803. {
  804. new client;
  805. client = GetClientOfUserId(GetEventInt(event, "userid"));
  806. if(client>0)
  807. {
  808. if(_abClientDead[client])
  809. {
  810. _aiKillStreak[client]=0;
  811. _abClientDead[client]=false;
  812. }
  813. }
  814. }
  815.  
  816. public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  817. {
  818. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  819. new String:sAttackerID[32];
  820. GetEventString(event, "attacker",sAttackerID, sizeof(sAttackerID));
  821.  
  822. new victim = GetClientOfUserId(GetEventInt(event, "userid"))
  823. new String:sVictimID[32];
  824. GetEventString(event, "userid",sVictimID, sizeof(sVictimID));
  825. new String:sKillStreakTemp[64];
  826. new String:sMultiKillStreakTemp[64];
  827. _abClientDead[victim]=true;
  828. decl String: _sTAGOverlay[192];
  829. GetConVarString(g_hTAGMess, _sTAGOverlay, sizeof(_sTAGOverlay));
  830. new String:attacker_name[65]
  831. new String:client_name[65]
  832. GetClientName(attacker, attacker_name, sizeof(attacker_name))
  833. GetClientName(victim, client_name, sizeof(client_name))
  834.  
  835. if(GetConVarInt(g_hKillOverlayEnabled) == 1 )
  836. {
  837. if(attacker>0 )
  838. {
  839. if(!IsFakeClient(attacker))
  840. {
  841. if(victim != attacker)
  842. {
  843. _aiKillStreak[attacker]++;
  844. if(_aiKillStreak[attacker]>_iMaxKillStreak)
  845. {
  846. _aiKillStreak[attacker]=1;
  847. }
  848.  
  849.  
  850. IntToString(_aiKillStreak[attacker], sKillStreakTemp,sizeof(sKillStreakTemp));
  851.  
  852. // CPrintToChatAllEx(victim,"%t","numberkills",_sTAGOverlay, sKillStreakTemp);
  853. ServerCommand("sm_tockillmess_show %s %s%s",sVictimID,_sKillOverlayNaming,sKillStreakTemp);
  854. }
  855. }
  856. }
  857. }
  858.  
  859. if (GetConVarInt(g_hMultiKillOverlayEnabled) == 1 )
  860. {
  861. g_killCount[victim] = 0;
  862. if(g_taskCountdown[victim] !=INVALID_HANDLE)
  863. {
  864. KillTimer(g_taskCountdown[victim]);
  865. g_taskCountdown[victim] =INVALID_HANDLE;
  866. }
  867.  
  868. if(attacker <1 || attacker == victim )
  869. return;
  870.  
  871. if(IsFakeClient(attacker) || GetEntityTeam(attacker) == GetEntityTeam(victim))
  872. return;
  873.  
  874. if(g_killCount[attacker] < GetConVarInt(g_hMultiKillStreak))
  875. g_killCount[attacker]++;
  876.  
  877. if(g_taskCountdown[attacker] !=INVALID_HANDLE)
  878. {
  879. KillTimer(g_taskCountdown[attacker]);
  880. g_taskCountdown[attacker] =INVALID_HANDLE;
  881. }
  882. g_taskCountdown[attacker] = CreateTimer(1.0,task_Countdown,attacker,1);
  883.  
  884. if(g_killCount[attacker] > 1)
  885. {
  886. IntToString(g_killCount[attacker], sMultiKillStreakTemp,sizeof(sMultiKillStreakTemp));
  887. ServerCommand("sm_tockillmess_show %s %s%s",sAttackerID,_sMultiKillOverlay,sMultiKillStreakTemp);
  888. switch (g_killCount[attacker])
  889. {
  890. case 2:
  891. {
  892. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","doublekill",_sTAGOverlay, attacker_name,client_name);
  893. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","doublekill",_sTAGOverlay, attacker_name,client_name);
  894. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","doublekill",_sTAGOverlay, attacker_name,client_name);
  895. }
  896. case 3:
  897. {
  898. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","triplekill",_sTAGOverlay, attacker_name,client_name);
  899. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","triplekill",_sTAGOverlay, attacker_name,client_name);
  900. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","triplekill",_sTAGOverlay, attacker_name,client_name);
  901. }
  902. case 4:
  903. {
  904. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","fourkill",_sTAGOverlay, attacker_name,client_name);
  905. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","fourkill",_sTAGOverlay, attacker_name,client_name);
  906. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","fourkill",_sTAGOverlay, attacker_name,client_name);
  907. }
  908. case 5:
  909. {
  910. if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","combokill",_sTAGOverlay, attacker_name,client_name);
  911. if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","combokill",_sTAGOverlay, attacker_name,client_name);
  912. if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","combokill",_sTAGOverlay, attacker_name,client_name);
  913. }
  914. }
  915. // ShowKillMessage(attacker,g_killCount[attacker]-1);
  916. if(g_taskClean[attacker] !=INVALID_HANDLE)
  917. {
  918. KillTimer(g_taskClean[attacker]);
  919. g_taskClean[attacker] =INVALID_HANDLE;
  920. }
  921. g_taskClean[attacker] = CreateTimer(_dTimerLength,task_Clean,attacker);
  922. }
  923. }
  924. }
  925.  
  926. public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
  927. {
  928. if (GetConVarInt(g_Cvar_XlogWinner) == 1)
  929. {
  930. StopChain = true;
  931. new iWinningTeam = GetEventInt(event, "team");
  932.  
  933. if (iWinningTeam == 2)
  934. {
  935. for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
  936. {
  937. if(IsClientInGame(iClientCounter))
  938. {
  939. ServerCommand("sm_tockillmess_show %i %s",GetClientUserId(iClientCounter),_sAlliedWinsOverlay);
  940. }
  941. }
  942. }
  943. else if (iWinningTeam == 3)
  944. {
  945. for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
  946. {
  947. if(IsClientInGame(iClientCounter))
  948. {
  949. ServerCommand("sm_tockillmess_show %i %s",GetClientUserId(iClientCounter),_sAxisWinsOverlay);
  950. }
  951. }
  952. }
  953. }
  954. }
  955.  
  956. public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  957. {
  958. StopChain = false;
  959. for(new client=1;client <= g_iMaxClients;client++)
  960. {
  961. g_killCount[client] = 0;
  962. if(g_taskCountdown[client] !=INVALID_HANDLE)
  963. {
  964. KillTimer(g_taskCountdown[client]);
  965. g_taskCountdown[client] =INVALID_HANDLE;
  966. }
  967. }
  968. }
  969.  
  970. public Action:task_Countdown(Handle:Timer, any:client)
  971. {
  972. g_killCount[client] --;
  973. if(!IsPlayerAlive(client) || g_killCount[client]==0)
  974. {
  975. KillTimer(Timer);
  976. g_taskCountdown[client] = INVALID_HANDLE;
  977. }
  978. }
  979.  
  980. public Action:task_Clean(Handle:Timer, any:client)
  981. {
  982. KillTimer(Timer);
  983. g_taskClean[client] = INVALID_HANDLE;
  984.  
  985. //if(!IsPlayerUseZoomWeapon(client)&&IsClientZooming(client))
  986. //return;
  987. ClientCommand(client, "r_screenoverlay \"\"");
  988. }
  989.  
  990. public OnClientConnected(client)
  991. {
  992. ClientCommand(client,"r_drawscreenoverlay 1");
  993. }
  994.  
  995. public OnClientDisconnect_Post(client)
  996. {
  997. if(g_taskCountdown[client] !=INVALID_HANDLE)
  998. {
  999. KillTimer(g_taskCountdown[client]);
  1000. g_taskCountdown[client] =INVALID_HANDLE;
  1001. }
  1002.  
  1003. if(g_taskClean[client] !=INVALID_HANDLE)
  1004. {
  1005. KillTimer(g_taskClean[client]);
  1006. g_taskClean[client] =INVALID_HANDLE;
  1007. }
  1008. }
  1009.  
  1010.  
  1011. stock GetEntityTeam(entity)
  1012. {
  1013. return GetEntProp(entity, Prop_Send, "m_iTeamNum");
  1014. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement