Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * DoD XtraLog
- *
- * Adds messaging and log events for alt weapon position kills so
- * stats packages can track and award them. Both psychostats and HLStatsXCE
- * can track these events and use for awards/bonuses.
- *
- * IE:
- * Single shot on the support class..
- * IronSight for the rifles.
- * "Rambo" for the mg class.
- * NoScope and Noscope headshots
- *
- * Kudos:
- * Tsunami for the pm secks. <3
- * psychonic for being hooker #1 <3
- *
- */
- #include <sourcemod>
- #include <sdktools>
- #include <morecolors>
- #define PLUGIN_VERSION "1.35multikill"
- // MultiKill
- new Handle:g_taskCountdown[MAXPLAYERS+1] = INVALID_HANDLE
- new Handle:g_taskClean[MAXPLAYERS+1] = INVALID_HANDLE
- new g_killCount[MAXPLAYERS+1] = 0
- new g_iMaxClients = 0
- new Handle:_atCleanTimer[MAXPLAYERS+1] = INVALID_HANDLE
- new Handle:_hTimerLength;
- new Float:_dTimerLength;
- new Handle:_hWinnerTimerLength;
- new Float:_dWinnerTimerLength;
- new _iMaxKillStreak;
- new _iMultiKillStreak;
- new _aiKillStreak[MAXPLAYERS+1];
- new _abClientDead[MAXPLAYERS+1];
- new bool:StopChain
- //new Handle:g_Cvar_XlogCountViewInfoPlayersOverlays (0=off,1=attacker,2=victim,3=all attacker and victim)
- //new Handle:g_Cvar_XlogViewInfoPlayersTextChat (0=off,1=attacker,2=victim,3=all attacker and victim)
- new Handle:g_Cvar_XlogNS
- new Handle:g_Cvar_XlogHS
- new Handle:g_Cvar_XlogMG
- new Handle:g_Cvar_XlogDetoNade
- new Handle:g_Cvar_XlogMeelee
- new Handle:g_Cvar_XlogPunch
- new Handle:g_Cvar_XlogSupport
- new Handle:g_Cvar_XlogRifle
- new Handle:g_Cvar_XlogBazooka
- new Handle:g_Cvar_XlogGrenade
- new Handle:g_Cvar_XlogPistol
- new Handle:g_Cvar_XlogSuicide
- new Handle:g_Cvar_XlogTeamKiller
- new Handle:g_Cvar_XlogWinner
- new Handle:g_Cvar_ViewChatText
- new Handle:g_Cvar_ViewOverlays
- new Handle:g_Cvar_XlogLogs
- new Handle:g_hKillOverlayEnabled
- new Handle:g_hMultiKillOverlayEnabled
- new Handle:g_hMeeleeMessOverlay
- new Handle:g_hTAGMess
- new Handle:g_hDetonadeMessOverlay
- new Handle:g_hNoscopeOverlay
- new Handle:g_hHeadShotOverlay
- new Handle:g_hMGMessOverlay
- new Handle:g_hSupportOverlay
- new Handle:g_hBazookaOverlay
- new Handle:g_hIronsigntOverlay
- new Handle:g_hPunchOverlay
- new Handle:g_hGrenadeOverlay
- new Handle:g_hAlliedWinsOverlay
- new Handle:g_hAxisWinsOverlay
- new Handle:g_hKillOverlayNaming
- new Handle:g_hMaxKillStreak
- new Handle:g_hPathOverLay
- new Handle:g_hPistolOverlay
- new Handle:g_hSuicideOverlay
- new Handle:g_hTeamKillerOverlay
- new Handle:g_hMultiKillOverlay
- new Handle:g_hMultiKillStreak
- new String:_sNoscopeOverlay[32]
- new String:_sHeadShotOverlay[32]
- new String:_sMGMessOverlay[32]
- new String:_sSupportOverlay[32]
- new String:_sBazookaOverlay[32]
- new String:_sPunchOverlay[32]
- new String:_sIronsigntOverlay[32]
- new String:_sMeeleeOverlay[32]
- new String:_sDetoNadeMessOverlay[32]
- new String:_sGrenadeOverlay[32]
- new String:_sAlliedWinsOverlay[32]
- new String:_sAxisWinsOverlay[32]
- new String:_sKillOverlayNaming[32]
- new String:_sPistolOverlay[32]
- new String:_sSuicideOverlay[32]
- new String:_sTeamKillerOverlay[32]
- new String:_sMultiKillOverlay[32]
- // Добавить возможность вкл и выкл на стороне клиента картинок
- //
- //
- //
- //
- //
- // sPathOverlays
- //g_Cvar_XlogTAG,g_hTAGOverlay
- // GetConVarString(g_hTAGOverlay, _sTAGText, sizeof(_sTAGText));
- // if (GetConVarInt(g_Cvar_XlogTAG) == 1) CPrintToChatAll("{lightgreen}%s {olive} %t ","meelee", tag, attacker_name)
- // CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name)
- //
- // ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverlays,sOverLay);
- //
- // added client_name in CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name,client_name)
- //
- // winner team overlays
- // ON-OFF Overlays the sm_tockillmess_show ==public Action:ShowKillMessage(args)
- // sPathOverlays
- //g_Cvar_XlogTAG,g_hTAGOverlay
- // GetConVarString(g_hTAGOverlay, _sTAGText, sizeof(_sTAGText));
- // if (GetConVarInt(g_Cvar_XlogTAG) == 1) CPrintToChatAll("{lightgreen}%s {olive} %t ","meelee", tag, attacker_name)
- //
- // CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name)
- //
- // ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverlays,sOverLay);
- //
- // added client_name in CPrintToChatAll("{lightgreen}[TOC XLog Overlays]{olive} %t ","meelee", attacker_name,client_name)
- // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
- // CPrintToChatAll("%t","meelee",_sTAGOverlay, attacker_name,client_name)
- // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
- // if (GetConVarInt(g_Cvar_VictimOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
- // }
- // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //
- //
- // winner team overlays
- // ON-OFF Overlays the sm_toskillmess_show ==public Action:ShowKillMessage(args)
- // Print client_name for text chat
- //
- // on off view overlyas teams
- // через массив выод nbgf Spray[weapon_pos "punch",meelee,meelee, bnl] OverlaysWeapons["",""]
- // new String:WpnMelee[4][] = { "", "", "weapon_amerknife", "weapon_spade" }
- // показывать всем или выборочно . но учесть и киллнэмэйнинг
- // GetClientName(attacker, attacker_name, sizeof(attacker_name))
- // GetClientName(client, client_name, sizeof(client_name))
- //
- // new String:WeaponPos[40][] = { "", "_sMeeleeOverlay", "_sMeeleeOverlay", "_sPistolOverlay", "_sPistolOverlay" }
- // ServerCommand("sm_tockillmess_show %s %s",sAttackerID,WeaponPos[weapon_pos]);
- // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
- // if (GetConVarInt(g_Cvar_VictimOverlays) == 1) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
- // text see attacker & victim name and overlays only attacker
- // 0=off 1=for all 2=on attacker 3=on victim
- // if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","pistol",_sTAGOverlay, attacker_name,client_name);
- //
- // if (GetConVarInt(g_Cvar_VictimOverlays) == 2 || GetConVarInt(g_Cvar_VictimOverlays) == 3) CPrintToChat("%t","pistol",_sTAGOverlay, attacker_name,client_name);
- // g_Cvar_ViewChatText
- // if (GetConVarInt(g_Cvar_AttackerOverlays) == 1 || GetConVarInt(g_Cvar_VictimOverlays) == 2) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
- // if (GetConVarInt(g_Cvar_VictimOverlays) == 1 || GetConVarInt(g_Cvar_VictimOverlays) == 3) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
- // strlen(string)
- //g_hKillOverlayEnabled
- // if (GetConVarInt(g_hKillOverlayEnabled) == 1))
- // sm_toc_enabled
- // sm_toc_bs_length
- // sm_toc_bs_path
- // sm_toc_bs_tag
- // sm_toc_bs_enabled_weapon=xxx
- // sm_toc_bs_weapon_xxxxx
- // sm_toc_bs_winteam_enabled
- // sm_toc_bs_winteam_allied
- // sm_toc_bs_winteam_axis
- // sm_toc_bs_winteam_killnaming
- // sm_toc_bs_winteam_maxkillstreak
- // BuildPath(Path_SM, logfile, sizeof(logfile), "logs/mylogfile.txt"); LogToFile(logfile, "My log: ...");
- // \"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname
- //
- // 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);
- //GetEngineVersion
- //
- public Plugin:myinfo =
- {
- name = "DoD Xtralog plus Overlays for servers(morecolors) fix 1.35",
- author = "Siang Chun & Black Haze & Xeon & Mosalar & T@HK",
- description = "Extra weapon logging info plus Overlays for servers(morecolors)",
- version = PLUGIN_VERSION,
- url = "http://www.budznetwork.com,http://dayofdefeat.ucoz.net/"
- }
- public OnPluginStart()
- {
- CreateConVar("sm_bs_toc_version", PLUGIN_VERSION, "Extra weapon logging info plus overlays version")
- _hTimerLength = CreateConVar("sm_toc_overlays_view_length", "3.0", "Время показа картинки (в сек.)");
- _dTimerLength = GetConVarFloat(_hTimerLength);
- _hWinnerTimerLength = CreateConVar("sm_toc_winner_overlays_view_length", "7.0", "Время показа картинки во время победы из команд (в сек.)");
- _dWinnerTimerLength = GetConVarFloat(_hWinnerTimerLength);
- g_Cvar_ViewChatText = CreateConVar("sm_toc_view_textchat", "1", "Показ в текстовом чате инофрмации от убийствах (0=выкл,1=всем (кто убил , кого убили),2=кого убили,3=кто убил)")
- g_Cvar_ViewOverlays = CreateConVar("sm_toc_view_overlays", "1", "Показ картинки(оверлея) на оружие - кто убил(attacker) или кого убили(victim) 0=всем,1=кто убил,2=жертве-кого убили")
- // g_Cvar_VictimOverlays = CreateConVar("sm_dod_xlog_overlays_view", "1", "Overlays Victim ON/OFF(1/0)")
- // g_Cvar_AttackerOverlays = CreateConVar("sm_dod_xlog_overlays_view", "1", "Overlays Attacker ON/OFF(1/0)")
- g_Cvar_XlogLogs = CreateConVar("sm_toc_logs_enables", "0", "Включить запись лога в файл об убийствах ../logs")
- g_hTAGMess = CreateConVar("sm_toc_name_tag", "[TOC XLog Overlays]", "Тэг перед текстом")
- // g_Cvar_XlogPathOverlays = CreateConVar("sm_dod_xlog_pathoverlays", "1", "Meelee Messages")
- g_hPathOverLay = CreateConVar("sm_toc_name_path", "toc_overlays", "Путь для папки с Материалами/Overlays - materials/имя вашей папки")
- g_Cvar_XlogMeelee = CreateConVar("sm_toc_bs_meelee_enabled", "1", "Meelee Messages")
- g_hMeeleeMessOverlay = CreateConVar("sm_toc_bs_meelee_overlays", "meelee", "Материал (убийство с ножа/лопатой)")
- g_Cvar_XlogDetoNade = CreateConVar("sm_toc_bs_detonade_enabled", "1", "DetoNade Messages")
- g_hDetonadeMessOverlay = CreateConVar("sm_toc_bs_detonade_overlays", "deto_naded", "Материал (убийство с винтовочных гранат)")
- g_Cvar_XlogNS = CreateConVar("sm_toc_bs_ns_enabled", "1", "NoScope messages")
- g_hNoscopeOverlay = CreateConVar("sm_toc_bs_ns_overlays", "unscope", "Материал (убийство без прицела)")
- g_Cvar_XlogHS = CreateConVar("sm_toc_bs_hs_enabled", "1", "NoScope HeadShot messages")
- g_hHeadShotOverlay = CreateConVar("sm_toc_bs_hs_overlays", "headshot", "Материал (убийство в голову без прицела)")
- g_Cvar_XlogMG = CreateConVar("sm_toc_bs_mg_enabled", "1", "MG Messages")
- g_hMGMessOverlay = CreateConVar("sm_toc_bs_mg_overlays", "mgkill", "Материал (убийство с рук MG)")
- g_Cvar_XlogSupport = CreateConVar("sm_toc_bs_support_enabled", "1", "Support Messages")
- g_hSupportOverlay = CreateConVar("sm_toc_bs_support_overlays", "support", "Материал (убийство с поддержки одиночным выстрелом)")
- g_Cvar_XlogPunch = CreateConVar("sm_toc_bs_punch_enabled", "1", "Punch Messages")
- g_hPunchOverlay = CreateConVar("sm_toc_bs_punch_overlays", "punch", "Материал (убийство кулаком)")
- g_Cvar_XlogRifle = CreateConVar("sm_toc_bs_rifle_enabled", "1", "Ironsight Messages")
- g_hIronsigntOverlay = CreateConVar("sm_toc_bs_rifle_overlays", "ironsight", "Материал (убийство с прицельно из винтовки)")
- g_Cvar_XlogGrenade = CreateConVar("sm_toc_bs_grenade_enabled", "1", "Grenade Messages")
- g_hGrenadeOverlay = CreateConVar("sm_toc_bs_grenade_overlays", "toc_grenade", "Материал (убийство с гранаты)");
- g_Cvar_XlogBazooka = CreateConVar("sm_toc_bs_bazooka_enabled", "1", "Rocket Messages", FCVAR_PLUGIN)
- g_hBazookaOverlay = CreateConVar("sm_toc_bs_bazooka_overlays", "rocket", "Материал (убийство из базуки)")
- g_Cvar_XlogPistol = CreateConVar("sm_toc_bs_pistol_enabled", "1", "Pistol Messages", FCVAR_PLUGIN)
- g_hPistolOverlay = CreateConVar("sm_toc_bs_pistol_overlays", "pistol", "Материал (убийство c пистолета)")
- g_Cvar_XlogSuicide = CreateConVar("sm_toc_bs_suicide_enabled", "1", "Suicide Messages", FCVAR_PLUGIN)
- g_hSuicideOverlay = CreateConVar("sm_toc_bs_suicide_overlays", "suicide", "Материал на самоубийство ")
- g_Cvar_XlogTeamKiller = CreateConVar("sm_toc_bs_teamkiller_enabled", "1", "Team Killer Messages", FCVAR_PLUGIN)
- g_hTeamKillerOverlay = CreateConVar("sm_toc_bs_teamkiller_overlays", "teamkiller", "Материал на убийство своих по команде")
- g_Cvar_XlogWinner = CreateConVar("sm_toc_winteam_all_enabled", "0", "Winner Teams Overlays", FCVAR_PLUGIN)
- g_hAlliedWinsOverlay = CreateConVar("sm_toc_winteam_allied", "toc_allied_wins", "Материал (Американцы одержали победу)");
- g_hAxisWinsOverlay = CreateConVar("sm_toc_winteam_axis", "toc_axis_wins", "Материал (Немцы одержали победу)");
- g_hKillOverlayEnabled = CreateConVar("sm_toc_killnaming_enabled", "0", "Включить показ убийств по кол-ву 0=нет/1=вкл (убийства от бота не показывается)");
- g_hKillOverlayNaming = CreateConVar("sm_toc_killnaming_overlay", "toc_", "Материал (Названия простого убийство под номером 1-10)");
- g_hMaxKillStreak = CreateConVar("sm_toc_maxkillstreak_overlay", "10", "Сколько тут ? (Сколько материалов будет подключаться для обычного убийства)");
- // MultiKill
- g_hMultiKillOverlayEnabled = CreateConVar("sm_toc_multikill_enabled", "1", "Включить показ одновременных убийств(multikill) по кол-ву 0=нет/1=вкл (убийства от бота не показывается !!????)");
- g_hMultiKillOverlay = CreateConVar("sm_toc_multikill_overlay", "multikill_", "Материал (Названия убийств за 1 раз(multikill) под номерами 2-5)");
- g_hMultiKillStreak = CreateConVar("sm_toc_multikillmax_overlay", "5", "Сколько тут ? (Сколько материалов будет подключаться для одновременных убийств 2=мин, 5=мах)", FCVAR_PLUGIN, true, 2.0, true, 5.0);
- RegServerCmd("sm_tockillmess_show", ShowKillMessage);
- RegServerCmd("sm_tockillmess_prepare", PrepareOverlay);
- HookEvent("player_death", Event_PlayerDeath);
- HookEvent("player_spawn", Event_PlayerSpawn);
- HookEvent("dod_round_win", Event_RoundEnd);
- HookEvent("dod_round_start", Event_RoundStart);
- HookEvent("dod_stats_player_damage", PlayerDamageEvent)
- LoadTranslations("toc_overlays_multikill.phrases");
- AutoExecConfig()
- }
- public OnMapStart()
- {
- g_iMaxClients = GetMaxClients();
- if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
- GetConVarString(g_hMeeleeMessOverlay, _sMeeleeOverlay, sizeof(_sMeeleeOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sMeeleeOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogDetoNade) == 1) {
- GetConVarString(g_hDetonadeMessOverlay, _sDetoNadeMessOverlay, sizeof(_sDetoNadeMessOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sDetoNadeMessOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogNS) == 1) {
- GetConVarString(g_hNoscopeOverlay, _sNoscopeOverlay, sizeof(_sNoscopeOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sNoscopeOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogHS) == 1) {
- GetConVarString(g_hHeadShotOverlay, _sHeadShotOverlay, sizeof(_sHeadShotOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sHeadShotOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogMG) == 1) {
- GetConVarString(g_hMGMessOverlay, _sMGMessOverlay, sizeof(_sMGMessOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sMGMessOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogSupport) == 1) {
- GetConVarString(g_hSupportOverlay, _sSupportOverlay, sizeof(_sSupportOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sSupportOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogPunch) == 1) {
- GetConVarString(g_hPunchOverlay, _sPunchOverlay, sizeof(_sPunchOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sPunchOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogRifle) == 1) {
- GetConVarString(g_hIronsigntOverlay, _sIronsigntOverlay, sizeof(_sIronsigntOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sIronsigntOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogGrenade) == 1) {
- GetConVarString(g_hGrenadeOverlay, _sGrenadeOverlay, sizeof(_sGrenadeOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sGrenadeOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogWinner) == 1) {
- GetConVarString(g_hAlliedWinsOverlay, _sAlliedWinsOverlay, sizeof(_sAlliedWinsOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sAlliedWinsOverlay);
- GetConVarString(g_hAxisWinsOverlay, _sAxisWinsOverlay, sizeof(_sAxisWinsOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sAxisWinsOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogBazooka) == 1) {
- GetConVarString(g_hBazookaOverlay, _sBazookaOverlay, sizeof(_sBazookaOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sBazookaOverlay)
- }
- if (GetConVarInt(g_Cvar_XlogPistol) == 1) {
- GetConVarString(g_hPistolOverlay, _sPistolOverlay, sizeof(_sPistolOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sPistolOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogSuicide) == 1) {
- GetConVarString(g_hSuicideOverlay, _sSuicideOverlay, sizeof(_sSuicideOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sSuicideOverlay);
- }
- if (GetConVarInt(g_Cvar_XlogTeamKiller) == 1) {
- GetConVarString(g_hTeamKillerOverlay, _sTeamKillerOverlay, sizeof(_sTeamKillerOverlay));
- ServerCommand("sm_tockillmess_prepare %s",_sTeamKillerOverlay);
- }
- if (GetConVarInt(g_hKillOverlayEnabled) == 1) {
- GetConVarString(g_hKillOverlayNaming, _sKillOverlayNaming, sizeof(_sKillOverlayNaming));
- _iMaxKillStreak = GetConVarInt(g_hMaxKillStreak);
- new iCounter;
- for (iCounter = 1; iCounter <= _iMaxKillStreak; iCounter++)
- {
- new String:sCounterTemp[64];
- IntToString(iCounter, sCounterTemp,sizeof(sCounterTemp));
- ServerCommand("sm_tockillmess_prepare %s%s",_sKillOverlayNaming,sCounterTemp);
- }
- }
- if (GetConVarInt(g_hMultiKillOverlayEnabled) == 1) {
- GetConVarString(g_hMultiKillOverlay, _sMultiKillOverlay, sizeof(_sMultiKillOverlay));
- _iMultiKillStreak = GetConVarInt(g_hMultiKillStreak);
- new iMultiCounter;
- for (iMultiCounter = 2; iMultiCounter <= _iMultiKillStreak; iMultiCounter++)
- {
- new String:sMultiCounterTemp[64];
- IntToString(iMultiCounter, sMultiCounterTemp,sizeof(sMultiCounterTemp));
- ServerCommand("sm_tockillmess_prepare %s%s",_sMultiKillOverlay,sMultiCounterTemp);
- }
- }
- }
- public PlayerDamageEvent(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
- new client = GetClientOfUserId(GetEventInt(event, "victim"))
- if (attacker == 0 || !IsClientInGame(attacker) || !IsPlayerAlive(attacker) || StopChain || g_killCount[attacker] > 1) {
- return
- }
- new String:auth[33]
- new String:attacker_name[65]
- new String:client_name[65]
- new String:tname[33]
- new String:cname[33]
- new String:wname[65]
- new String:sAttackerID[32];
- new weapon_pos = GetEventInt(event, "weapon")
- new hitgroup = GetEventInt(event, "hitgroup")
- new userid = GetClientUserId(attacker)
- //decl String:color[10]; Format(color, sizeof(color), "%s", GetClientTeam(attacker) == 2 ? "\x074D7942" : "\x07FF4040")
- GetClientName(attacker, attacker_name, sizeof(attacker_name))
- GetClientName(client, client_name, sizeof(client_name))
- // GetClientAuthString(attacker, auth, sizeof(auth))
- GetTeamName(GetClientTeam(attacker), tname, sizeof(tname))
- GetTeamName(GetClientTeam(client), cname, sizeof(cname))
- GetClientWeapon(attacker, wname, sizeof(wname))
- // new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
- GetEventString(event, "attacker",sAttackerID, sizeof(sAttackerID))
- // new victim = GetClientOfUserId(GetEventInt(event, "userid"));
- // new String:sVictimID[32];
- new String:sClientID[32];
- // GetEventString(event, "userid",sVictimID, sizeof(sVictimID));
- GetEventString(event, "userid",sClientID, sizeof(sClientID));
- new String:_sTAGOverlay[64];
- GetConVarString(g_hTAGMess, _sTAGOverlay, sizeof(_sTAGOverlay));
- if(GetClientHealth(client) < 1 && attacker == client) {
- if (GetConVarInt(g_Cvar_XlogSuicide) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","suicide",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","suicide",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","suicide",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSuicideOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSuicideOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSuicideOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSuicideOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"suicide\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- return ;
- }
- if (client != 0) {
- if (GetClientHealth(client) < 1 && GetClientTeam(attacker) == GetClientTeam(client)) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogTeamKiller) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","teamkiller",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sTeamKillerOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sTeamKillerOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sTeamKillerOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sTeamKillerOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"teamkiller\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- return ;
- }
- switch (weapon_pos) {
- case 1,2: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogMeelee) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","meelee",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","meelee",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","meelee",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMeeleeOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMeeleeOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"meelee\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 3,4: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogPistol) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","pistol",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","pistol",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","pistol",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPistolOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPistolOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPistolOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPistolOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"pistol\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 9,10: {
- if (GetClientHealth(client) < 1) {
- if (hitgroup == 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogHS) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","headshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","headshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","headshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sHeadShotOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sHeadShotOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sHeadShotOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sHeadShotOverlay);
- }
- }
- else {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogNS) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","noscope",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","noscope",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","noscope",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sNoscopeOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sNoscopeOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sNoscopeOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sNoscopeOverlay);
- }
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"noscope\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 17,18: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogBazooka) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","bazooka",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","bazooka",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","bazooka",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sBazookaOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sBazookaOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sBazookaOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sBazookaOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"rocketman\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 19,20: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogGrenade) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","grenade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","grenade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","grenade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sGrenadeOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sGrenadeOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sGrenadeOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sGrenadeOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"grenade\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 25,26: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogDetoNade) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","detonade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","detonade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","detonade",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sDetoNadeMessOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sDetoNadeMessOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sDetoNadeMessOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sDetoNadeMessOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"detonade\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 29,30: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogPunch) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","punch",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","punch",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","punch",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPunchOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPunchOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sPunchOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sPunchOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"punch\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 31,32: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogRifle) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","ironsight",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","ironsight",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","ironsight",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sIronsigntOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sIronsigntOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sIronsigntOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sIronsigntOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"ironsight\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 35,36: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogMG) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","rambo",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","rambo",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","rambo",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMGMessOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMGMessOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sMGMessOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sMGMessOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"rambo\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- case 37,38: {
- if (GetClientHealth(client) < 1) {
- if (attacker == 0 || !IsPlayerAlive(attacker)) {
- return
- }
- if (GetConVarInt(g_Cvar_XlogSupport) == 1) {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","singleshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","singleshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","singleshot",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 0 )
- {
- ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSupportOverlay);
- ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSupportOverlay);
- }
- if (GetConVarInt(g_Cvar_ViewOverlays) == 1 ) ServerCommand("sm_tockillmess_show %s %s",sAttackerID,_sSupportOverlay);
- if (GetConVarInt(g_Cvar_ViewOverlays) == 2 ) ServerCommand("sm_tockillmess_show %s %s",sClientID,_sSupportOverlay);
- }
- LogToGame("\"%s<%d><%s><%s>\" triggered \"singleshot\" with \"%s\"", attacker_name, userid, auth, tname, wname);
- //BuildPath(Path_SM, logfile, sizeof(logfile), "logs/toc_logfile.txt");
- 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);
- }
- }
- }
- }
- }
- public Action:ShowKillMessage(args)
- {
- if (args < 2)
- {
- return Plugin_Handled;
- }
- decl String: client_id[192];
- GetCmdArg(1, client_id, sizeof(client_id));
- new client = GetClientOfUserId(StringToInt(client_id));
- if(IsClientConnected(client) && !IsFakeClient(client))
- {
- decl String: sOverLay[192];
- GetCmdArg(2, sOverLay, sizeof(sOverLay));
- decl String: sPathOverLay[192];
- GetConVarString(g_hPathOverLay, sPathOverLay, sizeof(sPathOverLay))
- if(_atCleanTimer[client] !=INVALID_HANDLE)
- {
- KillTimer(_atCleanTimer[client]);
- _atCleanTimer[client] =INVALID_HANDLE;
- }
- if (StopChain)
- {
- _atCleanTimer[client] = CreateTimer(_dWinnerTimerLength,CleanTimer,client);
- }
- else
- {
- _atCleanTimer[client] = CreateTimer(_dTimerLength,CleanTimer,client);
- }
- ClearScreen(client);
- // PrintToChatAll("r_screenoverlay \"%s/%s.vtf\"",sPathOverLay,sOverLay);
- ClientCommand(client, "r_screenoverlay \"%s/%s.vtf\"",sPathOverLay,sOverLay);
- }
- return Plugin_Handled;
- }
- public ClearScreen(client)
- {
- if(IsClientConnected(client) && !IsFakeClient(client))
- {
- ClientCommand(client, "r_screenoverlay \"\"");
- }
- }
- public Action:CleanTimer(Handle:Timer, any:client)
- {
- _atCleanTimer[client] = INVALID_HANDLE;
- ClearScreen(client);
- }
- public Action:PrepareOverlay(args)
- {
- if (args < 1)
- {
- return Plugin_Handled;
- }
- decl String: sOverLay[192];
- GetCmdArg(1, sOverLay, sizeof(sOverLay));
- decl String: sPathOverLay[192];
- GetConVarString(g_hPathOverLay, sPathOverLay, sizeof(sPathOverLay))
- new String:overlays_file[64];
- new String:overlays_dltable[64];
- Format(overlays_file,sizeof(overlays_file),"%s/%s.vtf",sPathOverLay,sOverLay);
- PrecacheDecal(overlays_file,true);
- Format(overlays_dltable,sizeof(overlays_dltable),"materials/%s/%s.vtf",sPathOverLay,sOverLay);
- AddFileToDownloadsTable(overlays_dltable);
- Format(overlays_file,sizeof(overlays_file),"%s/%s.vmt",sPathOverLay,sOverLay);
- PrecacheDecal(overlays_file,true);
- Format(overlays_dltable,sizeof(overlays_dltable),"materials/%s/%s.vmt",sPathOverLay,sOverLay);
- AddFileToDownloadsTable(overlays_dltable);
- return Plugin_Handled;
- }
- public OnClientPutInServer(client)
- {
- if(client>0)
- {
- _aiKillStreak[client]=0;
- _abClientDead[client]=false;
- }
- }
- public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client;
- client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(client>0)
- {
- if(_abClientDead[client])
- {
- _aiKillStreak[client]=0;
- _abClientDead[client]=false;
- }
- }
- }
- public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
- new String:sAttackerID[32];
- GetEventString(event, "attacker",sAttackerID, sizeof(sAttackerID));
- new victim = GetClientOfUserId(GetEventInt(event, "userid"))
- new String:sVictimID[32];
- GetEventString(event, "userid",sVictimID, sizeof(sVictimID));
- new String:sKillStreakTemp[64];
- new String:sMultiKillStreakTemp[64];
- _abClientDead[victim]=true;
- decl String: _sTAGOverlay[192];
- GetConVarString(g_hTAGMess, _sTAGOverlay, sizeof(_sTAGOverlay));
- new String:attacker_name[65]
- new String:client_name[65]
- GetClientName(attacker, attacker_name, sizeof(attacker_name))
- GetClientName(victim, client_name, sizeof(client_name))
- if(GetConVarInt(g_hKillOverlayEnabled) == 1 )
- {
- if(attacker>0 )
- {
- if(!IsFakeClient(attacker))
- {
- if(victim != attacker)
- {
- _aiKillStreak[attacker]++;
- if(_aiKillStreak[attacker]>_iMaxKillStreak)
- {
- _aiKillStreak[attacker]=1;
- }
- IntToString(_aiKillStreak[attacker], sKillStreakTemp,sizeof(sKillStreakTemp));
- // CPrintToChatAllEx(victim,"%t","numberkills",_sTAGOverlay, sKillStreakTemp);
- ServerCommand("sm_tockillmess_show %s %s%s",sVictimID,_sKillOverlayNaming,sKillStreakTemp);
- }
- }
- }
- }
- if (GetConVarInt(g_hMultiKillOverlayEnabled) == 1 )
- {
- g_killCount[victim] = 0;
- if(g_taskCountdown[victim] !=INVALID_HANDLE)
- {
- KillTimer(g_taskCountdown[victim]);
- g_taskCountdown[victim] =INVALID_HANDLE;
- }
- if(attacker <1 || attacker == victim )
- return;
- if(IsFakeClient(attacker) || GetEntityTeam(attacker) == GetEntityTeam(victim))
- return;
- if(g_killCount[attacker] < GetConVarInt(g_hMultiKillStreak))
- g_killCount[attacker]++;
- if(g_taskCountdown[attacker] !=INVALID_HANDLE)
- {
- KillTimer(g_taskCountdown[attacker]);
- g_taskCountdown[attacker] =INVALID_HANDLE;
- }
- g_taskCountdown[attacker] = CreateTimer(1.0,task_Countdown,attacker,1);
- if(g_killCount[attacker] > 1)
- {
- IntToString(g_killCount[attacker], sMultiKillStreakTemp,sizeof(sMultiKillStreakTemp));
- ServerCommand("sm_tockillmess_show %s %s%s",sAttackerID,_sMultiKillOverlay,sMultiKillStreakTemp);
- switch (g_killCount[attacker])
- {
- case 2:
- {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","doublekill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","doublekill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","doublekill",_sTAGOverlay, attacker_name,client_name);
- }
- case 3:
- {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","triplekill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","triplekill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","triplekill",_sTAGOverlay, attacker_name,client_name);
- }
- case 4:
- {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","fourkill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","fourkill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","fourkill",_sTAGOverlay, attacker_name,client_name);
- }
- case 5:
- {
- if (GetConVarInt(g_Cvar_ViewChatText) == 1 ) CPrintToChatAll("%t","combokill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 2 ) CPrintToChatAll(attacker_name,"%t","combokill",_sTAGOverlay, attacker_name,client_name);
- if (GetConVarInt(g_Cvar_ViewChatText) == 3 ) CPrintToChatAll(client_name,"%t","combokill",_sTAGOverlay, attacker_name,client_name);
- }
- }
- // ShowKillMessage(attacker,g_killCount[attacker]-1);
- if(g_taskClean[attacker] !=INVALID_HANDLE)
- {
- KillTimer(g_taskClean[attacker]);
- g_taskClean[attacker] =INVALID_HANDLE;
- }
- g_taskClean[attacker] = CreateTimer(_dTimerLength,task_Clean,attacker);
- }
- }
- }
- public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
- {
- if (GetConVarInt(g_Cvar_XlogWinner) == 1)
- {
- StopChain = true;
- new iWinningTeam = GetEventInt(event, "team");
- if (iWinningTeam == 2)
- {
- for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
- {
- if(IsClientInGame(iClientCounter))
- {
- ServerCommand("sm_tockillmess_show %i %s",GetClientUserId(iClientCounter),_sAlliedWinsOverlay);
- }
- }
- }
- else if (iWinningTeam == 3)
- {
- for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
- {
- if(IsClientInGame(iClientCounter))
- {
- ServerCommand("sm_tockillmess_show %i %s",GetClientUserId(iClientCounter),_sAxisWinsOverlay);
- }
- }
- }
- }
- }
- public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
- {
- StopChain = false;
- for(new client=1;client <= g_iMaxClients;client++)
- {
- g_killCount[client] = 0;
- if(g_taskCountdown[client] !=INVALID_HANDLE)
- {
- KillTimer(g_taskCountdown[client]);
- g_taskCountdown[client] =INVALID_HANDLE;
- }
- }
- }
- public Action:task_Countdown(Handle:Timer, any:client)
- {
- g_killCount[client] --;
- if(!IsPlayerAlive(client) || g_killCount[client]==0)
- {
- KillTimer(Timer);
- g_taskCountdown[client] = INVALID_HANDLE;
- }
- }
- public Action:task_Clean(Handle:Timer, any:client)
- {
- KillTimer(Timer);
- g_taskClean[client] = INVALID_HANDLE;
- //if(!IsPlayerUseZoomWeapon(client)&&IsClientZooming(client))
- //return;
- ClientCommand(client, "r_screenoverlay \"\"");
- }
- public OnClientConnected(client)
- {
- ClientCommand(client,"r_drawscreenoverlay 1");
- }
- public OnClientDisconnect_Post(client)
- {
- if(g_taskCountdown[client] !=INVALID_HANDLE)
- {
- KillTimer(g_taskCountdown[client]);
- g_taskCountdown[client] =INVALID_HANDLE;
- }
- if(g_taskClean[client] !=INVALID_HANDLE)
- {
- KillTimer(g_taskClean[client]);
- g_taskClean[client] =INVALID_HANDLE;
- }
- }
- stock GetEntityTeam(entity)
- {
- return GetEntProp(entity, Prop_Send, "m_iTeamNum");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement