Advertisement
FlacoBey

Untitled

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