Advertisement
FlacoBey

Untitled

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