Advertisement
FlacoBey

Untitled

Jun 15th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 21.02 KB | None | 0 0
  1. #pragma semicolon 1
  2. #pragma newdecls required
  3.  
  4. #include <sdktools>
  5.  
  6. Handle sdkSetAttack;
  7.  
  8. float weapon_autoshotgun = 300.0;
  9. float weapon_hunting_rifle  = 0.0;
  10. float weapon_pistol  = 100000.0;
  11. float weapon_pistol_magnum  = 0.0;
  12. float weapon_pumpshotgun  = 0.0;
  13. float weapon_rifle  = 0.0;
  14. float weapon_rifle_ak47  = 0.0;
  15. float weapon_rifle_desert  = 0.0;
  16. float weapon_rifle_m60  = 0.0;
  17. float weapon_rifle_sg552  = 0.0;
  18. float weapon_shotgun_chrome  = 0.0;
  19. float weapon_shotgun_spas  = 0.0;
  20. float weapon_smg  = 0.0;
  21. float weapon_smg_mp5  = 0.0;
  22. float weapon_smg_silenced  = 0.0;
  23. float weapon_sniper_awp  = 0.0;
  24. float weapon_sniper_military  = 0.0;
  25. float weapon_sniper_scout  = 0.0;
  26.  
  27. float weapon_grenade_launcher  = 0.0;
  28. float weapon_pipe_bomb = 100000.0;
  29.  
  30. float melee = 0.0;
  31.  
  32. bool IsInflicted;
  33.  
  34. int iChance = 10;
  35.  
  36. public void OnPluginStart()
  37. {
  38.     Handle hGameConf = LoadGameConfigFile("SetAttackSurvivorCommons");
  39.     StartPrepSDKCall(SDKCall_Entity);
  40.     if( PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "SetAttackToSurvivors") == false )
  41.         SetFailState("Could not load the \"SetAttackToSurvivors\" gamedata signature.");
  42.     sdkSetAttack = EndPrepSDKCall();
  43.    
  44.     HookEvent("weapon_fire", EventFire);
  45. }
  46.  
  47. public void OnMapStart()
  48. {
  49.     IsInflicted = false;
  50.     CreateTimer(20.0, vActivate);
  51. }
  52.  
  53. public Action vActivate(Handle timer)
  54. {
  55.     IsInflicted = true;
  56. }
  57.  
  58. public Action EventFire(Handle event, const char[] name, bool dontbroadcast)
  59. {
  60.     int client = GetClientOfUserId(GetEventInt(event, "userid"));
  61.     if(!bIsSurvivor(client)) return;
  62.     char sWeaponEx[56];
  63.     GetEventString(event, "weapon", sWeaponEx, sizeof(sWeaponEx));
  64.     float vPos[3], vTargetPos[3];
  65.     GetEntPropVector(client, Prop_Send, "m_vecOrigin", vPos);
  66.     if(strcmp(sWeaponEx, "melee") == 0)
  67.     {
  68.         for(int i = 33; i <= 2048; i++)
  69.         {
  70.             if(IsCommonInfected(i))
  71.             {
  72.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  73.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  74.                 if(IsVisibleTo(vPos, vTargetPos))
  75.                 {
  76.                     if(fTargetDistance < melee)
  77.                     {
  78.                         SDKCall(sdkSetAttack, i);
  79.                     }
  80.                 }
  81.                 else
  82.                 {
  83.                     if(GetRandomInt(0, 100) <= iChance)
  84.                     {
  85.                         if(fTargetDistance < melee)
  86.                         {
  87.                             SDKCall(sdkSetAttack, i);
  88.                         }
  89.                     }
  90.                 }
  91.             }
  92.         }
  93.     }
  94.     else if(strcmp(sWeaponEx, "autoshotgun") == 0)
  95.     {
  96.         for(int i = 33; i <= 2048; i++)
  97.         {
  98.             if(IsCommonInfected(i))
  99.             {
  100.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  101.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  102.                 if(IsVisibleTo(vPos, vTargetPos))
  103.                 {
  104.                     if(fTargetDistance < weapon_autoshotgun)
  105.                     {
  106.                         SDKCall(sdkSetAttack, i);
  107.                     }
  108.                 }
  109.                 else
  110.                 {
  111.                     if(GetRandomInt(0, 100) <= iChance)
  112.                     {
  113.                         if(fTargetDistance < weapon_autoshotgun)
  114.                         {
  115.                             SDKCall(sdkSetAttack, i);
  116.                         }
  117.                     }
  118.                 }
  119.             }
  120.         }
  121.     }
  122.     else if(strcmp(sWeaponEx, "hunting_rifle") == 0)
  123.     {
  124.         for(int i = 33; i <= 2048; i++)
  125.         {
  126.             if(IsCommonInfected(i))
  127.             {
  128.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  129.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  130.                 if(IsVisibleTo(vPos, vTargetPos))
  131.                 {
  132.                     if(fTargetDistance < weapon_hunting_rifle)
  133.                     {
  134.                         SDKCall(sdkSetAttack, i);
  135.                     }
  136.                 }
  137.                 else
  138.                 {
  139.                     if(GetRandomInt(0, 100) <= iChance)
  140.                     {
  141.                         if(fTargetDistance < weapon_hunting_rifle)
  142.                         {
  143.                             SDKCall(sdkSetAttack, i);
  144.                         }
  145.                     }
  146.                 }
  147.             }
  148.         }
  149.     }
  150.     else if(strcmp(sWeaponEx, "pistol") == 0)
  151.     {
  152.         for(int i = 33; i <= 2048; i++)
  153.         {
  154.             if(IsCommonInfected(i))
  155.             {
  156.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  157.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  158.                 if(IsVisibleTo(vPos, vTargetPos))
  159.                 {
  160.                     if(fTargetDistance < weapon_pistol)
  161.                     {
  162.                         SDKCall(sdkSetAttack, i);
  163.                     }
  164.                 }
  165.                 else
  166.                 {
  167.                     if(GetRandomInt(0, 100) <= iChance)
  168.                     {
  169.                         if(fTargetDistance < weapon_pistol)
  170.                         {
  171.                             SDKCall(sdkSetAttack, i);
  172.                         }
  173.                     }
  174.                 }
  175.             }
  176.         }
  177.     }
  178.     else if(strcmp(sWeaponEx, "pistol_magnum") == 0)
  179.     {
  180.         for(int i = 33; i <= 2048; i++)
  181.         {
  182.             if(IsCommonInfected(i))
  183.             {
  184.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  185.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  186.                 if(IsVisibleTo(vPos, vTargetPos))
  187.                 {
  188.                     if(fTargetDistance < weapon_pistol_magnum)
  189.                     {
  190.                         SDKCall(sdkSetAttack, i);
  191.                     }
  192.                 }
  193.                 else
  194.                 {
  195.                     if(GetRandomInt(0, 100) <= iChance)
  196.                     {
  197.                         if(fTargetDistance < weapon_pistol_magnum)
  198.                         {
  199.                             SDKCall(sdkSetAttack, i);
  200.                         }
  201.                     }
  202.                 }
  203.             }
  204.         }
  205.     }
  206.     else if(strcmp(sWeaponEx, "pumpshotgun") == 0)
  207.     {
  208.         for(int i = 33; i <= 2048; i++)
  209.         {
  210.             if(IsCommonInfected(i))
  211.             {
  212.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  213.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  214.                 if(IsVisibleTo(vPos, vTargetPos))
  215.                 {
  216.                     if(fTargetDistance < weapon_pumpshotgun)
  217.                     {
  218.                         SDKCall(sdkSetAttack, i);
  219.                     }
  220.                 }
  221.                 else
  222.                 {
  223.                     if(GetRandomInt(0, 100) <= iChance)
  224.                     {
  225.                         if(fTargetDistance < weapon_pumpshotgun)
  226.                         {
  227.                             SDKCall(sdkSetAttack, i);
  228.                         }
  229.                     }
  230.                 }
  231.             }
  232.         }
  233.     }
  234.     else if(strcmp(sWeaponEx, "rifle") == 0)
  235.     {
  236.         for(int i = 33; i <= 2048; i++)
  237.         {
  238.             if(IsCommonInfected(i))
  239.             {
  240.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  241.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  242.                 if(IsVisibleTo(vPos, vTargetPos))
  243.                 {
  244.                     if(fTargetDistance < weapon_rifle)
  245.                     {
  246.                         SDKCall(sdkSetAttack, i);
  247.                     }
  248.                 }
  249.                 else
  250.                 {
  251.                     if(GetRandomInt(0, 100) <= iChance)
  252.                     {
  253.                         if(fTargetDistance < weapon_rifle)
  254.                         {
  255.                             SDKCall(sdkSetAttack, i);
  256.                         }
  257.                     }
  258.                 }
  259.             }
  260.         }
  261.     }
  262.     else if(strcmp(sWeaponEx, "rifle_ak47") == 0)
  263.     {
  264.         for(int i = 33; i <= 2048; i++)
  265.         {
  266.             if(IsCommonInfected(i))
  267.             {
  268.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  269.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  270.                 if(IsVisibleTo(vPos, vTargetPos))
  271.                 {
  272.                     if(fTargetDistance < weapon_rifle_ak47)
  273.                     {
  274.                         SDKCall(sdkSetAttack, i);
  275.                     }
  276.                 }
  277.                 else
  278.                 {
  279.                     if(GetRandomInt(0, 100) <= iChance)
  280.                     {
  281.                         if(fTargetDistance < weapon_rifle_ak47)
  282.                         {
  283.                             SDKCall(sdkSetAttack, i);
  284.                         }
  285.                     }
  286.                 }
  287.             }
  288.         }
  289.     }
  290.     else if(strcmp(sWeaponEx, "rifle_desert") == 0)
  291.     {
  292.         for(int i = 33; i <= 2048; i++)
  293.         {
  294.             if(IsCommonInfected(i))
  295.             {
  296.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  297.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  298.                 if(IsVisibleTo(vPos, vTargetPos))
  299.                 {
  300.                     if(fTargetDistance < weapon_rifle_desert)
  301.                     {
  302.                         SDKCall(sdkSetAttack, i);
  303.                     }
  304.                 }
  305.                 else
  306.                 {
  307.                     if(GetRandomInt(0, 100) <= iChance)
  308.                     {
  309.                         if(fTargetDistance < weapon_rifle_desert)
  310.                         {
  311.                             SDKCall(sdkSetAttack, i);
  312.                         }
  313.                     }
  314.                 }
  315.             }
  316.         }
  317.     }
  318.     else if(strcmp(sWeaponEx, "rifle_m60") == 0)
  319.     {
  320.         for(int i = 33; i <= 2048; i++)
  321.         {
  322.             if(IsCommonInfected(i))
  323.             {
  324.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  325.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  326.                 if(IsVisibleTo(vPos, vTargetPos))
  327.                 {
  328.                     if(fTargetDistance < weapon_rifle_m60)
  329.                     {
  330.                         SDKCall(sdkSetAttack, i);
  331.                     }
  332.                 }
  333.                 else
  334.                 {
  335.                     if(GetRandomInt(0, 100) <= iChance)
  336.                     {
  337.                         if(fTargetDistance < weapon_rifle_m60)
  338.                         {
  339.                             SDKCall(sdkSetAttack, i);
  340.                         }
  341.                     }
  342.                 }
  343.             }
  344.         }
  345.     }
  346.     else if(strcmp(sWeaponEx, "rifle_sg552") == 0)
  347.     {
  348.         for(int i = 33; i <= 2048; i++)
  349.         {
  350.             if(IsCommonInfected(i))
  351.             {
  352.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  353.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  354.                 if(IsVisibleTo(vPos, vTargetPos))
  355.                 {
  356.                     if(fTargetDistance < weapon_rifle_sg552)
  357.                     {
  358.                         SDKCall(sdkSetAttack, i);
  359.                     }
  360.                 }
  361.                 else
  362.                 {
  363.                     if(GetRandomInt(0, 100) <= iChance)
  364.                     {
  365.                         if(fTargetDistance < weapon_rifle_sg552)
  366.                         {
  367.                             SDKCall(sdkSetAttack, i);
  368.                         }
  369.                     }
  370.                 }
  371.             }
  372.         }
  373.     }
  374.     else if(strcmp(sWeaponEx, "shotgun_chrome") == 0)
  375.     {
  376.         for(int i = 33; i <= 2048; i++)
  377.         {
  378.             if(IsCommonInfected(i))
  379.             {
  380.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  381.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  382.                 if(IsVisibleTo(vPos, vTargetPos))
  383.                 {
  384.                     if(fTargetDistance < weapon_shotgun_chrome)
  385.                     {
  386.                         SDKCall(sdkSetAttack, i);
  387.                     }
  388.                 }
  389.                 else
  390.                 {
  391.                     if(GetRandomInt(0, 100) <= iChance)
  392.                     {
  393.                         if(fTargetDistance < weapon_shotgun_chrome)
  394.                         {
  395.                             SDKCall(sdkSetAttack, i);
  396.                         }
  397.                     }
  398.                 }
  399.             }
  400.         }
  401.     }
  402.     else if(strcmp(sWeaponEx, "shotgun_spas") == 0)
  403.     {
  404.         for(int i = 33; i <= 2048; i++)
  405.         {
  406.             if(IsCommonInfected(i))
  407.             {
  408.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  409.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  410.                 if(IsVisibleTo(vPos, vTargetPos))
  411.                 {
  412.                     if(fTargetDistance < weapon_shotgun_spas)
  413.                     {
  414.                         SDKCall(sdkSetAttack, i);
  415.                     }
  416.                 }
  417.                 else
  418.                 {
  419.                     if(GetRandomInt(0, 100) <= iChance)
  420.                     {
  421.                         if(fTargetDistance < weapon_shotgun_spas)
  422.                         {
  423.                             SDKCall(sdkSetAttack, i);
  424.                         }
  425.                     }
  426.                 }
  427.             }
  428.         }
  429.     }
  430.     else if(strcmp(sWeaponEx, "smg") == 0)
  431.     {
  432.         for(int i = 33; i <= 2048; i++)
  433.         {
  434.             if(IsCommonInfected(i))
  435.             {
  436.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  437.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  438.                 if(IsVisibleTo(vPos, vTargetPos))
  439.                 {
  440.                     if(fTargetDistance < weapon_smg)
  441.                     {
  442.                         SDKCall(sdkSetAttack, i);
  443.                     }
  444.                 }
  445.                 else
  446.                 {
  447.                     if(GetRandomInt(0, 100) <= iChance)
  448.                     {
  449.                         if(fTargetDistance < weapon_smg)
  450.                         {
  451.                             SDKCall(sdkSetAttack, i);
  452.                         }
  453.                     }
  454.                 }
  455.             }
  456.         }
  457.     }
  458.     else if(strcmp(sWeaponEx, "smg_mp5") == 0)
  459.     {
  460.         for(int i = 33; i <= 2048; i++)
  461.         {
  462.             if(IsCommonInfected(i))
  463.             {
  464.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  465.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  466.                 if(IsVisibleTo(vPos, vTargetPos))
  467.                 {
  468.                     if(fTargetDistance < weapon_smg_mp5)
  469.                     {
  470.                         SDKCall(sdkSetAttack, i);
  471.                     }
  472.                 }
  473.                 else
  474.                 {
  475.                     if(GetRandomInt(0, 100) <= iChance)
  476.                     {
  477.                         if(fTargetDistance < weapon_smg_mp5)
  478.                         {
  479.                             SDKCall(sdkSetAttack, i);
  480.                         }
  481.                     }
  482.                 }
  483.             }
  484.         }
  485.     }
  486.     else if(strcmp(sWeaponEx, "smg_silenced") == 0)
  487.     {
  488.         for(int i = 33; i <= 2048; i++)
  489.         {
  490.             if(IsCommonInfected(i))
  491.             {
  492.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  493.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  494.                 if(IsVisibleTo(vPos, vTargetPos))
  495.                 {
  496.                     if(fTargetDistance < weapon_smg_silenced)
  497.                     {
  498.                         SDKCall(sdkSetAttack, i);
  499.                     }
  500.                 }
  501.                 else
  502.                 {
  503.                     if(GetRandomInt(0, 100) <= iChance)
  504.                     {
  505.                         if(fTargetDistance < weapon_smg_silenced)
  506.                         {
  507.                             SDKCall(sdkSetAttack, i);
  508.                         }
  509.                     }
  510.                 }
  511.             }
  512.         }
  513.     }
  514.     else if(strcmp(sWeaponEx, "sniper_awp") == 0)
  515.     {
  516.         for(int i = 33; i <= 2048; i++)
  517.         {
  518.             if(IsCommonInfected(i))
  519.             {
  520.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  521.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  522.                 if(IsVisibleTo(vPos, vTargetPos))
  523.                 {
  524.                     if(fTargetDistance < weapon_sniper_awp)
  525.                     {
  526.                         SDKCall(sdkSetAttack, i);
  527.                     }
  528.                 }
  529.                 else
  530.                 {
  531.                     if(GetRandomInt(0, 100) <= iChance)
  532.                     {
  533.                         if(fTargetDistance < weapon_sniper_awp)
  534.                         {
  535.                             SDKCall(sdkSetAttack, i);
  536.                         }
  537.                     }
  538.                 }
  539.             }
  540.         }
  541.     }
  542.     else if(strcmp(sWeaponEx, "sniper_military") == 0)
  543.     {
  544.         for(int i = 33; i <= 2048; i++)
  545.         {
  546.             if(IsCommonInfected(i))
  547.             {
  548.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  549.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  550.                 if(IsVisibleTo(vPos, vTargetPos))
  551.                 {
  552.                     if(fTargetDistance < weapon_sniper_military)
  553.                     {
  554.                         SDKCall(sdkSetAttack, i);
  555.                     }
  556.                 }
  557.                 else
  558.                 {
  559.                     if(GetRandomInt(0, 100) <= iChance)
  560.                     {
  561.                         if(fTargetDistance < weapon_sniper_military)
  562.                         {
  563.                             SDKCall(sdkSetAttack, i);
  564.                         }
  565.                     }
  566.                 }
  567.             }
  568.         }
  569.     }
  570.     else if(strcmp(sWeaponEx, "sniper_scout") == 0)
  571.     {
  572.         for(int i = 33; i <= 2048; i++)
  573.         {
  574.             if(IsCommonInfected(i))
  575.             {
  576.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  577.                 float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  578.                 if(IsVisibleTo(vPos, vTargetPos))
  579.                 {
  580.                     if(fTargetDistance < weapon_sniper_scout)
  581.                     {
  582.                         SDKCall(sdkSetAttack, i);
  583.                     }
  584.                 }
  585.                 else
  586.                 {
  587.                     if(GetRandomInt(0, 100) <= iChance)
  588.                     {
  589.                         if(fTargetDistance < weapon_sniper_scout)
  590.                         {
  591.                             SDKCall(sdkSetAttack, i);
  592.                         }
  593.                     }
  594.                 }
  595.             }
  596.         }
  597.     }
  598. }
  599.  
  600. public void OnEntityDestroyed(int entity)
  601. {
  602.     if(!IsInflicted) return;
  603.     if(IsValidEntity(entity) && IsValidEdict(entity))
  604.     {
  605.         char sTypeEx[36];
  606.         GetEntityClassname(entity, sTypeEx, sizeof(sTypeEx));
  607.         if(strcmp(sTypeEx, "grenade_launcher_projectile") == 0)
  608.         {
  609.             float vPos[3], vTargetPos[3];
  610.             GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
  611.             for(int i = 33; i <= 2048; i++)
  612.             {
  613.                 if(IsCommonInfected(i))
  614.                 {
  615.                     GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  616.                     float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  617.                     if(fTargetDistance < weapon_grenade_launcher)
  618.                     {
  619.                         SDKCall(sdkSetAttack, i);
  620.                     }
  621.                 }
  622.             }
  623.         }
  624.         else if(strcmp(sTypeEx, "pipe_bomb_projectile") == 0)
  625.         {
  626.             float vPos[3], vTargetPos[3];
  627.             GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
  628.             for(int i = 33; i <= 2048; i++)
  629.             {
  630.                 if(IsCommonInfected(i))
  631.                 {
  632.                     GetEntPropVector(i, Prop_Send, "m_vecOrigin", vTargetPos);
  633.                     float fTargetDistance = GetVectorDistance(vPos, vTargetPos);
  634.                     if(fTargetDistance < weapon_pipe_bomb)
  635.                     {
  636.                         SDKCall(sdkSetAttack, i);
  637.                     }
  638.                 }
  639.             }
  640.         }
  641.     }
  642. }
  643.  
  644. static bool IsVisibleTo(float position[3], float targetposition[3])
  645. {
  646.     float vAngles[3], vLookAt[3];
  647.    
  648.     MakeVectorFromPoints(position, targetposition, vLookAt);
  649.     GetVectorAngles(vLookAt, vAngles);
  650.  
  651.     Handle trace = TR_TraceRayFilterEx(position, vAngles, MASK_SHOT, RayType_Infinite, _TraceFilter);
  652.    
  653.     bool isVisible = false;
  654.     if (TR_DidHit(trace))
  655.     {
  656.         float vStart[3];
  657.         TR_GetEndPosition(vStart, trace);
  658.        
  659.         if ((GetVectorDistance(position, vStart, false) + 25.0) >= GetVectorDistance(position, targetposition))
  660.         {
  661.             isVisible = true;
  662.         }
  663.     }
  664.    
  665.     return isVisible;
  666. }
  667.  
  668. public bool _TraceFilter(int entity, int contentsMask)
  669. {
  670.     if (!entity || entity <= MaxClients || !IsValidEntity(entity))
  671.     {
  672.         return false;
  673.     }
  674.     return true;
  675. }
  676.  
  677. stock bool bIsSurvivor(int client)
  678. {
  679.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  680. }
  681.  
  682. stock bool IsCommonInfected(int entity)
  683. {
  684.     if (entity > 0 && IsValidEntity(entity) && IsValidEdict(entity))
  685.     {
  686.         char entType[64];
  687.         GetEdictClassname(entity, entType, sizeof(entType));
  688.         return StrEqual(entType, "infected");
  689.     }
  690.     return false;
  691. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement