Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 19.62 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdkhooks>
  3.  
  4. // Settings
  5. int PlayerKill = 2;
  6. int Skeet = 2;
  7. int SkeetHurt = 1;
  8. int SkeetMelee = 3;
  9. int BoomerPop = 1;
  10. int TongueCut = 1;
  11. int SmokerSelfClear = 1;
  12. int JockeySkeet = 2;
  13. int ChargerLevel = 3;
  14. int ChargerLevelHurt = 1;
  15. int TankRockSkeeted = 1;
  16. int WitchCrown = 3;
  17. int SpecialClearX = 4;
  18. int SpecialClearA = 3;
  19. int SpecialClearB = 2;
  20. int SpecialClearC = 1;
  21. int TankRockEaten = -1;
  22. int CarAlarmTriggered = -4;
  23. int CarAlarmTriggeredBoomer = -6;
  24. int PlayerKilled = -5;
  25. int InfectedKill = 10;
  26. int PillsUsed = -3;
  27. int MedKitUsed = -4;
  28. int PlayerGetup = 1;
  29. int EachSurvivorDamage = 1;
  30. int EachThatCommonsAmount = 10;
  31. int EachCommonsAmount = 1;
  32. int EachThatSurvivorDamageAmount = 500;
  33. int EachInfectedDamage = 1;
  34. int EachThatInfectedDamageAmount = 50;
  35. int InfectedIncap = 5;
  36. int HunterCap = 2;
  37. int JockeyCap = 3;
  38. int SmokerCap = 1;
  39. int ChargerCap = 3;
  40. int ChargerImpact = 1;
  41. int ChargerInstaKill = 5;
  42. int BommerVomit = 1;
  43. int TankPunch = 1;
  44. int SurvivorAssist = 1;
  45. int PlayerIncapacitated = -2;
  46.  
  47. // Variables
  48. int Score[MAXPLAYERS + 1];
  49. int AcummulatedCommons[MAXPLAYERS +1];
  50. int TempAcummulatedCommons[MAXPLAYERS +1];
  51. int AcummulatedDamage[MAXPLAYERS + 1];
  52. int TempAcummulatedDamage[MAXPLAYERS + 1];
  53. int AcummulatedSurvivorKills[MAXPLAYERS +1];
  54. int AcummulatedInfectedKills[MAXPLAYERS +1];
  55. int DamageAssistTracker[MAXPLAYERS +1][MAXPLAYERS +1];
  56. int DamageJockeyTracker[MAXPLAYERS +1][MAXPLAYERS +1];
  57. float inflictedDamageToJockey[MAXPLAYERS +1][MAXPLAYERS +1];
  58. float JockeyDamageForSkeet;
  59.  
  60. public void OnPluginStart()
  61. {
  62.     HookEvent("player_death", OnPlayerDeath, EventHookMode_Post);
  63.     HookEvent("pills_used", OnPillsUsed, EventHookMode_Post);
  64.     HookEvent("heal_success", OnMedKitUsed, EventHookMode_Post);
  65.     HookEvent("player_incapacitated", OnPlayerIncapacitated_Event, EventHookMode_Post);
  66.     HookEvent("revive_success", OnPlayerGetup, EventHookMode_Post);
  67.     HookEvent("player_hurt", OnPlayerDamage, EventHookMode_Post);
  68.     HookEvent("tongue_grab", OnSmokerCap, EventHookMode_Post);
  69.     HookEvent("charger_carry_start", OnChargerCap, EventHookMode_Post);
  70.     HookEvent("charger_impact", OnChargerImpact, EventHookMode_Post);
  71.     //HookEvent("round_end", OnRoundEnd, EventHookMode_Post);
  72. }
  73.  
  74. public void OnConfigsExecuted()
  75. {
  76.     char jockeySkeetPlugin[] = "l4d2_jockey_skeet.smx";
  77.  
  78.     if (FindPluginByFile(jockeySkeetPlugin) != INVALID_HANDLE)
  79.     {
  80.         JockeyDamageForSkeet = GetConVarFloat(FindConVar("z_leap_damage_interrupt"));
  81.     }
  82. }
  83.  
  84. public void OnClientPutInServer(int client)
  85. {
  86.     SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  87. }
  88.  
  89. public void OnClientDisconnect(int client)
  90. {
  91.     SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  92. }
  93.  
  94. /*public void OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
  95. {
  96.     for (int i = 0; i <= MAXPLAYERS; i++)
  97.     {
  98.         if (GetClientTeam(i) == 2)
  99.         {
  100.             char player[255];
  101.             GetClientName(i, player, sizeof(player));
  102.            
  103.             PrintToChatAll("%s | kills: %i | damage: %i | score: %i", player, AcummulatedSurvivorKills[i], AcummulatedDamage[i], Score[i]);
  104.         }
  105.     }
  106. }
  107. */
  108.  
  109. void UpdateScore(int client, int amount)
  110. {
  111.     Score[client] += amount;
  112. }
  113.  
  114. void UpdateSurvivorDamage(int survivor, int damage)
  115. {
  116.     AcummulatedDamage[survivor] += damage;
  117.    
  118.     TempAcummulatedDamage[survivor] += damage;
  119.    
  120.     while (TempAcummulatedDamage[survivor] >= EachThatSurvivorDamageAmount)
  121.     {
  122.         UpdateScore(survivor, EachSurvivorDamage);
  123.         TempAcummulatedDamage[survivor] -= EachThatSurvivorDamageAmount;
  124.     }
  125. }
  126.  
  127. void UpdateInfectedDamage(int infected, int damage)
  128. {
  129.     AcummulatedDamage[infected] += damage;
  130.    
  131.     TempAcummulatedDamage[infected] += damage;
  132.    
  133.     while (TempAcummulatedDamage[infected] >= EachThatInfectedDamageAmount)
  134.     {
  135.         UpdateScore(infected, EachInfectedDamage);
  136.         TempAcummulatedDamage[infected] -= EachThatInfectedDamageAmount;
  137.     }
  138. }
  139.  
  140. void UpdateAcummulatedCommons(int survivor)
  141. {
  142.     AcummulatedCommons[survivor] += 1;
  143.    
  144.     TempAcummulatedCommons[survivor] += 1;
  145.    
  146.     while (TempAcummulatedCommons[survivor] >= EachThatCommonsAmount)
  147.     {
  148.         UpdateScore(survivor, EachCommonsAmount);
  149.         TempAcummulatedCommons[survivor] -= EachThatCommonsAmount;
  150.     }
  151. }
  152.  
  153. public void OnPlayerIncapacitated_Event(Event event, const char[] name, bool dontBroadcast)
  154. {
  155.     int survivorId = event.GetInt("userid");
  156.     int survivor = GetClientOfUserId(survivorId);
  157.    
  158.     int attackerId = event.GetInt("attacker");
  159.     int attacker = GetClientOfUserId(attackerId);
  160.    
  161.     if (GetClientTeam(survivor) == 2)
  162.     {
  163.         OnPlayerIncapacitated(survivor);
  164.     }
  165.    
  166.     OnPlayerIncapacitatedByInfected(attacker, survivor);
  167. }
  168.  
  169. public void OnPlayerDeath(Event event, const char[] name, bool dontBroadcast)
  170. {
  171.     int victimId = event.GetInt("userid");
  172.     int victim = GetClientOfUserId(victimId);
  173.    
  174.     int attackerId = event.GetInt("attacker");
  175.     int attacker = GetClientOfUserId(attackerId);
  176.  
  177.     int entityId = event.GetInt("entityid");
  178.    
  179.     char Classname[64];
  180.     GetEntityClassname(entityId, Classname, sizeof(Classname));
  181.    
  182.     char ClassnameCommon[] = "infected";   
  183.    
  184.     if (victim <= MAXPLAYERS)
  185.     {
  186.         if (GetClientTeam(victim) == 3 && GetClientTeam(attacker) == 2)
  187.         {
  188.             AcummulatedSurvivorKills[attacker] += 1;
  189.             OnSurvivorKill(attacker, victim);
  190.            
  191.             for (int i = 0; i <= MAXPLAYERS; i++)
  192.             {
  193.                 DamageAssistTracker[i][victim] = 0;
  194.             }
  195.         }
  196.    
  197.         if (GetClientTeam(victim) == 2 && GetClientTeam(attacker) == 3)
  198.         {
  199.             AcummulatedInfectedKills[attacker] += 1;
  200.             OnInfectedKill(attacker, victim);
  201.         }
  202.    
  203.         if (GetClientTeam(victim) == 2)
  204.         {
  205.             OnSurvivorKilled(victim);
  206.         }
  207.     }
  208.     else
  209.     {
  210.         if (GetClientTeam(attacker) == 2 && StrEqual(Classname, ClassnameCommon))
  211.         {
  212.             OnPlayerCommonKill(attacker);
  213.         }
  214.     }
  215. }
  216.  
  217. public void OnPlayerDamage(Event event, const char[] name, bool dontBroadcast)
  218. {
  219.     int victimId = event.GetInt("userid");
  220.     int victim = GetClientOfUserId(victimId);
  221.    
  222.     int attackerId = event.GetInt("attacker");
  223.     int attacker = GetClientOfUserId(attackerId);
  224.    
  225.     int damage = event.GetInt("dmg_health");
  226.    
  227.     if (GetClientTeam(attacker) == 2)
  228.     {
  229.         OnSurvivorDamage(attacker, damage, victim);
  230.        
  231.         DamageAssistTracker[attacker][victim] += damage;
  232.        
  233.         if (GetEntProp(victim, Prop_Send, "m_zombieClass") == 5)
  234.         {
  235.             DamageJockeyTracker[attacker][victim] += damage;
  236.         }
  237.     }
  238.     else if (GetClientTeam(attacker) == 3)
  239.     {
  240.         OnInfectedDamage(attacker, damage, victim);
  241.     }
  242. }
  243.  
  244. public Action OnTakeDamage(victim, &attacker, &inflictor, float damage, &damageType, &weapon, float damageForce[3], float damagePosition[3])
  245. {
  246.     char jockeySkeetPlugin[] = "l4d2_jockey_skeet.smx";
  247.  
  248.     if (FindPluginByFile(jockeySkeetPlugin) != INVALID_HANDLE)
  249.     {
  250.         OnJockeySkeet(victim, attacker, damage, weapon, JockeyDamageForSkeet);
  251.     }  
  252. }
  253.  
  254. // *********************************************************** //
  255. // ************* || P L A Y E R   C H E C K S || ************* //
  256. // *********************************************************** //
  257.  
  258. bool IsValidSurvivor(int survivor)
  259. {
  260.     return (survivor > 0
  261.         && survivor <= MAXPLAYERS
  262.         && IsClientInGame(survivor)
  263.         && GetClientTeam(survivor) == 2
  264.         && !IsFakeClient(survivor));
  265. }
  266.  
  267. bool IsValidInfected(int infected)
  268. {
  269.     return (infected > 0
  270.         && infected <= MAXPLAYERS
  271.         && IsClientInGame(infected)
  272.         && GetClientTeam(infected) == 3
  273.         && !IsFakeClient(infected));
  274. }
  275.  
  276. // *********************************************************** //
  277. // *********** || S U R V I V O R S   S K I L L || *********** //
  278. // *********************************************************** //
  279.  
  280. //// [ KILL ] ////
  281.  
  282. public Action OnSurvivorKill(int survivor, int infected)
  283. {
  284.     if (!IsValidSurvivor(survivor) || !IsValidInfected(infected))
  285.     {
  286.         PrintToServer("BOT involved, skipping");
  287.         return;
  288.     }
  289.    
  290.     UpdateScore(survivor, PlayerKill);
  291.    
  292.     for (int i = 0; i <= MAXPLAYERS; i++)
  293.     {
  294.         if (DamageAssistTracker[i][infected] > 100)
  295.         {
  296.             OnSurvivorAssist(i, infected);
  297.         }
  298.     }
  299. }
  300.  
  301. //// [ ASSIST ] ////
  302.  
  303. public Action OnSurvivorAssist(int survivor, int infected)
  304. {
  305.     if (!IsValidSurvivor(survivor) || !IsValidInfected(infected))
  306.     {
  307.         PrintToServer("BOT involved, skipping");
  308.         return;
  309.     }
  310.    
  311.     UpdateScore(survivor, SurvivorAssist);
  312. }
  313.  
  314. //// [ HUNTER SKILL ] ////
  315.  
  316. public void OnSkeet(int survivor, int hunter)
  317. {
  318.     if (!IsValidSurvivor(survivor) || !IsValidInfected(hunter))
  319.     {
  320.         PrintToServer("BOT involved, skipping");
  321.         return;
  322.     }
  323.    
  324.     UpdateScore(survivor, Skeet);
  325. }
  326.  
  327. public void OnSkeetHurt(int survivor, int hunter, int damage, bool isOverkill)
  328. {
  329.     if (!IsValidSurvivor(survivor) || !IsValidInfected(hunter))
  330.     {
  331.         PrintToServer("BOT involved, skipping");
  332.         return;
  333.     }
  334.    
  335.     if (isOverKill)
  336.     {
  337.         UpdateScore(survivor, Skeet);
  338.     }
  339.     else
  340.     {
  341.         UpdateScore(survivor, SkeetHurt);
  342.     }
  343. }
  344.  
  345. public void OnSkeetMelee(int survivor, int hunter)
  346. {
  347.     if (!IsValidSurvivor(survivor) || !IsValidInfected(hunter))
  348.     {
  349.         PrintToServer("BOT involved, skipping");
  350.         return;
  351.     }
  352.    
  353.     UpdateScore(survivor, SkeetMelee);
  354. }
  355.  
  356. public void OnSkeetMeleeHurt(int survivor, int hunter, int damage, bool isOverkill)
  357. {
  358.     if (!IsValidSurvivor(survivor) || !IsValidInfected(hunter))
  359.     {
  360.         PrintToServer("BOT involved, skipping");
  361.         return;
  362.     }
  363.    
  364.     if (isOverKill)
  365.     {
  366.         UpdateScore(survivor, SkeetMelee);
  367.     }
  368. }
  369.  
  370. //// [ BOOMER SKILL ] ////
  371.  
  372. public void OnBoomerPop(int survivor, int boomer, int shoveCount, float timeAlive)
  373. {
  374.     if (!IsValidSurvivor(survivor) || !IsValidInfected(boomer))
  375.     {
  376.         PrintToServer("BOT involved, skipping");
  377.         return;
  378.     }
  379.    
  380.     if (shoveCount < 1 && timeAlive < 2.0)
  381.     {
  382.         UpdateScore(survivor, BoomerPop);
  383.     }
  384. }
  385.  
  386. //// [ SMOKER SKILL ] ////
  387.  
  388. public void OnSmokerSelfClear(int survivor, int smoker, bool withShove)
  389. {
  390.     if (!IsValidSurvivor(survivor) || !IsValidInfected(smoker))
  391.     {
  392.         PrintToServer("BOT involved, skipping");
  393.         return;
  394.     }
  395.    
  396.     UpdateScore(survivor, SmokerSelfClear);
  397. }
  398.  
  399. public void OnTongueCut(int survivor, int smoker)
  400. {
  401.     if (!IsValidSurvivor(survivor) || !IsValidInfected(smoker))
  402.     {
  403.         PrintToServer("BOT involved, skipping");
  404.         return;
  405.     }
  406.    
  407.     UpdateScore(survivor, TongueCut);
  408. }
  409.  
  410. //// [ JOCKEY SKILL ] ////
  411.  
  412. public Action OnJockeySkeet(int victim, int attacker, float damage, int weapon, float JockeyDamageForSkeet)
  413. {
  414.     if (IsValidSurvivor(attacker)
  415.         && IsValidInfected(victim)
  416.         && GetEntProp(victim, Prop_Send, "m_zombieClass") == 5
  417.         && GetEntProp(victim, Prop_Send, "m_isGhost") != 1)
  418.     {
  419.         if (!HasJockeyTarget(victim) && IsAttachable(victim) && IsShotgun(weapon))
  420.         {
  421.             inflictedDamageToJockey[victim][attacker] += damage;
  422.            
  423.             if (inflictedDamageToJockey[victim][attacker] >= JockeyDamageForSkeet)
  424.             {
  425.                 UpdateScore(attacker, JockeySkeet);
  426.             }
  427.            
  428.             CreateTimer(0.1, ResetDamageCounter, victim);
  429.         }
  430.        
  431.         return Plugin_Continue;
  432.     }
  433.  
  434.     return Plugin_Continue;
  435. }
  436.  
  437. bool HasJockeyTarget(int infected)
  438. {
  439.     int client = GetEntDataEnt2(infected, 16124);
  440.     return (GetClientTeam(client) == 2 && IsPlayerAlive(client));
  441. }
  442.  
  443. bool IsAttachable(int jockey)
  444. {
  445.     return !(GetEntityFlags(jockey) & FL_ONGROUND);
  446. }
  447.  
  448. bool IsShotgun(int weapon)
  449. {
  450.     char weaponname[64];
  451.     GetEdictClassname(weapon, weaponname, sizeof(weaponname));
  452.     return (StrEqual(weaponname, "weapon_pumpshotgun") || StrEqual(weaponname, "weapon_shotgun_chrome"));
  453. }
  454.  
  455. public Action ResetDamageCounter(Handle timer, int jockey)
  456. {
  457.     for (int i = 1; i <= MAXPLAYERS; i++)
  458.     {
  459.         inflictedDamageToJockey[jockey][i] = 0.0;
  460.     }
  461. }
  462.  
  463. //// [ CHARGER SKILL ] ////
  464.  
  465. public void OnChargerLevel(int survivor, int charger)
  466. {
  467.     if (!IsValidSurvivor(survivor) || !IsValidInfected(charger))
  468.     {
  469.         PrintToServer("BOT involved, skipping");
  470.         return;
  471.     }
  472.    
  473.     UpdateScore(survivor, ChargerLevel);
  474. }
  475.  
  476. public void OnChargerLevelHurt(int survivor, int charger, int damage)
  477. {
  478.     if (!IsValidSurvivor(survivor) || !IsValidInfected(charger))
  479.     {
  480.         PrintToServer("BOT involved, skipping");
  481.         return;
  482.     }
  483.    
  484.     if (damage >= 100)
  485.     {
  486.         UpdateScore(survivor, ChargerLevelHurt);
  487.     }
  488.     else
  489.     {
  490.         return;
  491.     }
  492. }
  493.  
  494. //// [ TANK SKILL ] ////
  495.  
  496. public void OnTankRockSkeeted(int survivor, int tank)
  497. {
  498.     if (!IsValidSurvivor(survivor) || !IsValidInfected(tank))
  499.     {
  500.         PrintToServer("BOT involved, skipping");
  501.         return;
  502.     }
  503.    
  504.     UpdateScore(survivor, TankRockSkeeted);
  505. }
  506.  
  507. //// [ WITCH SKILL ] ////
  508.  
  509. public void OnWitchCrown(int survivor, int damage)
  510. {
  511.     if (!IsValidSurvivor(survivor))
  512.     {
  513.         PrintToServer("BOT involved, skipping");
  514.         return;
  515.     }
  516.    
  517.     if (damage >= 1000)
  518.     {
  519.         UpdateScore(survivor, WitchCrown);
  520.     }
  521. }
  522.  
  523. //// [ TEAM SKILL ] ////
  524.  
  525. public void OnSpecialClear(int clearer, int pinner, int pinvictim, int zombieClass, float timeA, float timeB, bool withShove)
  526. {
  527.     if (!IsValidSurvivor(clearer) || !IsValidSurvivor(pinvictim) || !IsValidInfected(pinner))
  528.     {
  529.         PrintToServer("BOT involved, skipping");
  530.         return;
  531.     }
  532.    
  533.     if (zombieClass == 6 || zombieClass == 1)
  534.     {
  535.         if (timeB != -1.0)
  536.         {
  537.             UpdateScore(clearer, SpecialClearX);
  538.         }
  539.     }
  540.     else
  541.     {
  542.         if (0.0 <= timeA < 1.0)
  543.         {
  544.             UpdateScore(clearer, SpecialClearA);
  545.         }
  546.         else if (1.0 <= timeA < 2.0)
  547.         {
  548.             UpdateScore(clearer, SpecialClearB);
  549.         }
  550.         else if (2.0 <= timeA)
  551.         {
  552.             UpdateScore(clearer, SpecialClearC);
  553.         }
  554.     }
  555. }
  556.  
  557. public void OnPlayerGetup(Event event, const char[] name, bool dontBroadcast)
  558. {
  559.     int survivorId = event.GetInt("userid");
  560.     int survivor = GetClientOfUserId(survivorId);
  561.    
  562.     int subjectId = event.GetInt("subject");
  563.     int survivor2 = GetClientOfUserId(subjectId);
  564.    
  565.     if (!IsValidSurvivor(survivor) || !IsValidSurvivor(survivor2))
  566.     {
  567.         PrintToServer("BOT involved, skipping");
  568.         return;
  569.     }
  570.    
  571.     UpdateScore(survivor, PlayerGetup);
  572. }
  573.  
  574. //// [ DAMAGE && COMMONS ] ////
  575.  
  576. public Action OnSurvivorDamage(int attacker, int damage, int victim)
  577. {
  578.     if (!IsValidSurvivor(attacker) || !IsValidInfected(victim))
  579.     {
  580.         PrintToServer("BOT involved, skipping");
  581.         return;
  582.     }
  583.    
  584.     UpdateSurvivorDamage(attacker, damage);
  585. }
  586.  
  587. public Action OnPlayerCommonKill(int survivor)
  588. {
  589.     if (!IsValidSurvivor(survivor))
  590.     {
  591.         PrintToServer("BOT involved, skipping");
  592.         return;
  593.     }
  594.    
  595.     UpdateAcummulatedCommons(survivor);
  596. }
  597.  
  598. // *********************************************************** //
  599. // ******** || S U R V I V O R S   F A I L U R E S || ******** //
  600. // *********************************************************** //
  601.  
  602. //// [ INCAPACITATED ] ////
  603.  
  604. public Action OnPlayerIncapacitated(int survivor)
  605. {
  606.     if (!IsValidSurvivor(survivor))
  607.     {
  608.         PrintToServer("BOT involved, skipping");
  609.         return;
  610.     }
  611.    
  612.     UpdateScore(survivor, PlayerIncapacitated);
  613. }
  614.  
  615. //// [ DIE ] ////
  616.  
  617. public Action OnSurvivorKilled(int survivor)
  618. {
  619.     if (!IsValidSurvivor(survivor))
  620.     {
  621.         PrintToServer("BOT involved, skipping");
  622.         return;
  623.     }
  624.    
  625.     UpdateScore(survivor, PlayerKilled);
  626. }
  627.  
  628. //// [ ROCK HIT ] ////
  629.  
  630. public void OnTankRockEaten(int tank, int survivor)
  631. {
  632.     if (!IsValidSurvivor(survivor) || !IsValidInfected(tank))
  633.     {
  634.         PrintToServer("BOT involved, skipping");
  635.         return;
  636.     }
  637.    
  638.     UpdateScore(survivor, TankRockEaten);
  639. }
  640.  
  641. //// [ USE MEDKIT ] ////
  642.  
  643. public void OnMedKitUsed(Event event, const char[] name, bool dontBroadcast)
  644. {
  645.     int survivorId = event.GetInt("userid");
  646.     int survivor = GetClientOfUserId(survivorId);
  647.    
  648.     if (!IsValidSurvivor(survivor))
  649.     {
  650.         PrintToServer("BOT involved, skipping");
  651.         return;
  652.     }
  653.    
  654.     UpdateScore(survivor, MedKitUsed);
  655. }
  656.  
  657. //// [ USE PILLS ] ////
  658.  
  659. public void OnPillsUsed(Event event, const char[] name, bool dontBroadcast)
  660. {
  661.     int survivorId = event.GetInt("userid");
  662.     int survivor = GetClientOfUserId(survivorId);
  663.    
  664.     if (!IsValidSurvivor(survivor))
  665.     {
  666.         PrintToServer("BOT involved, skipping");
  667.         return;
  668.     }
  669.    
  670.     UpdateScore(survivor, PillsUsed);
  671. }
  672.  
  673. //// [ CAR ALARM ] ////
  674.  
  675. public void OnCarAlarmTriggered(int survivor, int infected, int reason)
  676. {
  677.     if (!IsValidSurvivor(survivor))
  678.     {
  679.         PrintToServer("BOT involved, skipping");
  680.         return;
  681.     }
  682.    
  683.     if (reason == 4)
  684.     {
  685.         UpdateScore(survivor, CarAlarmTriggeredBoomer);
  686.     }
  687.     else
  688.     {
  689.         UpdateScore(survivor, CarAlarmTriggered);
  690.     }
  691. }
  692.  
  693. // *********************************************************** //
  694. // ************ || I N F E C T E D   S K I L L || ************ //
  695. // *********************************************************** //
  696.  
  697. //// [ DAMAGE ] ////
  698.  
  699. public Action OnInfectedDamage(int attacker, int damage, int victim)
  700. {
  701.     if (!IsValidSurvivor(victim) || !IsValidInfected(attacker))
  702.     {
  703.         PrintToServer("BOT involved, skipping");
  704.         return;
  705.     }
  706.    
  707.     UpdateInfectedDamage(attacker, damage);
  708.    
  709.     if (GetEntProp(attacker, Prop_Send, "m_zombieClass") == 8)
  710.     {
  711.         OnTankPunch(attacker, victim);
  712.     }
  713. }
  714.  
  715. //// [ KILLS ] ////
  716.  
  717. public Action OnInfectedKill(int infected, int survivor)
  718. {
  719.     if (!IsValidSurvivor(survivor) || !IsValidInfected(infected))
  720.     {
  721.         PrintToServer("BOT involved, skipping");
  722.         return;
  723.     }
  724.    
  725.     UpdateScore(infected, InfectedKill);
  726. }
  727.  
  728. //// [ INCAP ] ////
  729.  
  730. public Action OnPlayerIncapacitatedByInfected(int infected, int survivor)
  731. {
  732.     if (!IsValidSurvivor(survivor) || !IsValidInfected(infected))
  733.     {
  734.         PrintToServer("BOT involved, skipping");
  735.         return;
  736.     }
  737.    
  738.     UpdateScore(infected, InfectedIncap);
  739. }
  740.  
  741. //// [ HUNTER SKILL ] ////
  742.  
  743. public void OnHunterHighPounce(int hunter, int victim, int actualDamage, float calculatedDamage, float height, bool bReportedHigh, bool bPlayerIncapped)
  744. {
  745.     if (!IsValidSurvivor(victim) || !IsValidInfected(hunter))
  746.     {
  747.         PrintToServer("BOT involved, skipping");
  748.         return;
  749.     }
  750.    
  751.     UpdateScore(hunter, HunterCap);
  752. }
  753.  
  754. //// [ JOCKEY SKILL ] ////
  755.  
  756. public void OnJockeyHighPounce(int  jockey, int victim, float height, bool bReportedHigh)
  757. {
  758.     if (!IsValidSurvivor(victim) || !IsValidInfected(jockey))
  759.     {
  760.         PrintToServer("BOT involved, skipping");
  761.         return;
  762.     }
  763.    
  764.     UpdateScore(jockey, JockeyCap);
  765. }
  766.  
  767. //// [ SMOKER SKILL ] ////
  768.  
  769. public void OnSmokerCap(Event event, const char[] name, bool dontBroadcast)
  770. {
  771.     int userId = event.GetInt("userid");
  772.     int smoker = GetClientOfUserId(userId);
  773.    
  774.     int survivorId = event.GetInt("victim");
  775.     int survivor = GetClientOfUserId(survivorId);
  776.    
  777.     if (!IsValidSurvivor(survivor) || !IsValidInfected(smoker))
  778.     {
  779.         PrintToServer("BOT involved, skipping");
  780.         return;
  781.     }
  782.    
  783.     UpdateScore(smoker, SmokerCap);
  784. }
  785.  
  786. //// [ CHARGER SKILL ] ////
  787.  
  788. public void OnChargerCap(Event event, const char[] name, bool dontBroadcast)
  789. {
  790.     int userId = event.GetInt("userid");
  791.     int charger = GetClientOfUserId(userId);
  792.    
  793.     int survivorId = event.GetInt("victim");
  794.     int survivor = GetClientOfUserId(survivorId);
  795.    
  796.     if (!IsValidSurvivor(survivor) || !IsValidInfected(charger))
  797.     {
  798.         PrintToServer("BOT involved, skipping");
  799.         return;
  800.     }
  801.    
  802.     UpdateScore(charger, ChargerCap);
  803. }
  804.  
  805. public void OnChargerImpact(Event event, const char[] name, bool dontBroadcast)
  806. {
  807.     int userId = event.GetInt("userid");
  808.     int charger = GetClientOfUserId(userId);
  809.    
  810.     int survivorId = event.GetInt("victim");
  811.     int survivor = GetClientOfUserId(survivorId);
  812.    
  813.     if (!IsValidSurvivor(survivor) || !IsValidInfected(charger))
  814.     {
  815.         PrintToServer("BOT involved, skipping");
  816.         return;
  817.     }
  818.    
  819.     UpdateScore(charger, ChargerImpact);
  820. }
  821.  
  822. public void OnDeathCharge(int charger, int victim, float height, float distance, int wasCarried)
  823. {
  824.     if (!IsValidSurvivor(victim) || !IsValidInfected(charger))
  825.     {
  826.         PrintToServer("BOT involved, skipping");
  827.         return;
  828.     }
  829.    
  830.     UpdateScore(charger, ChargerInstaKill);
  831. }
  832.  
  833. //// [ BOOMER SKILL ] ////
  834.  
  835. public void OnBoomerVomitLanded(int boomer, int amount)
  836. {
  837.     if (!IsValidInfected(boomer))
  838.     {
  839.         PrintToServer("BOT involved, skipping");
  840.         return;
  841.     }
  842.    
  843.     for (int i = amount; i > 0; i--)
  844.     {
  845.         UpdateScore(boomer, BommerVomit);
  846.     }
  847. }
  848.  
  849. //// [ TANK SKILL ] ////
  850.  
  851. public void OnTankPunch(int attacker, int victim)
  852. {
  853.     if (!IsValidSurvivor(victim) || !IsValidInfected(attacker))
  854.     {
  855.         PrintToServer("BOT involved, skipping");
  856.         return;
  857.     }
  858.    
  859.     UpdateScore(attacker, TankPunch);
  860. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement