FlacoBey

Untitled

May 25th, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 112.20 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4. #include <smlib>
  5.  
  6. #if SOURCEMOD_V_MINOR < 7
  7.     #error Old version sourcemod!
  8. #endif
  9.  
  10. #pragma newdecls required
  11.  
  12. #define PARTICLE_FUSE       "weapon_pipebomb_fuse"
  13. #define PARTICLE_LIGHT      "weapon_pipebomb_blinking_light"
  14.  
  15. #define iMedkit     "models/w_models/weapons/w_eq_medkit.mdl"
  16. #define iPills  "models/w_models/weapons/w_eq_painpills.mdl"
  17. #define iAdrenaline     "models/w_models/weapons/w_eq_adrenaline.mdl"
  18. #define iMoDefib        "models/w_models/weapons/w_eq_defibrillator.mdl"
  19. #define iDwarf      "models/props_junk/gnome.mdl"
  20.  
  21. #define BEAMSPRITE      "materials/sprites/laserbeam.vmt"
  22. #define BEAMHALO        "materials/sprites/halo01.vmt"
  23.  
  24. #define iTake   "ui/bigreward.wav"
  25.  
  26. public Plugin myinfo=
  27. {
  28.     name = "[Skills]",
  29.     author = "BHaType",
  30.     description = "Выжившие могу покупать скилы и перки.",
  31.     version = "6.6.9",
  32.     url = "https://steamcommunity.com/id/fallinourblood/"
  33. };
  34.  
  35. /*
  36. new const String:Electables[][] =
  37. {  
  38.     "weapon_smg_mp5",
  39.     "weapon_smg",
  40.     "weapon_smg_silenced",
  41.     "weapon_shotgun_chrome",
  42.     "weapon_gascan"
  43. };
  44. */
  45.  
  46. ConVar iColorDefib, iColorDwarf, iColorAdrenalineCraft, iColorPillsCraft, iYourColor, yourColor, ResetEveryMap;
  47.  
  48. ConVar NeedToCraftPills, NeedToCraftAdrenaline, CostEpicMoli, CostEpicMoliUpgrade, CostHelpingHand, CostDoubleJump, CostSpeedUp, CostUpgradePipe,
  49.        CostUltraPipe, CostPipeIndixite, CostShoveDamage, CostAntiDamage, CostMeleeDamage, CostFastReload, CostExpAmmo, CostIncAmmo, CostLaserSight,
  50.        CostExpAmmoPack, CostIncAmmoPack, CostMinecraft, NeedToCraftMedkit, ChanceMedkit, ChancePills, ChanceAdrenaline, NeedToCraftDefib, NeedToCraftGnome,
  51.        ChanceToDropDefib, ChanceToDropGnome;
  52.  
  53. int iSprite;
  54. int iHalo;
  55.  
  56. int Cash[MAXPLAYERS + 1] = 0;
  57. int TeamCash = 5000;
  58. int Target[MAXPLAYERS + 1] = 0;
  59.  
  60. //For Double Jump
  61. int g_fLastButtons[MAXPLAYERS + 1];
  62. int g_fLastFlags[MAXPLAYERS + 1];
  63. int g_iJumps[MAXPLAYERS + 1];
  64. int g_iJumpMax = 1;
  65. // count of killed CommonInfecteds
  66. int CI[MAXPLAYERS+1] = 0;
  67. //
  68.  
  69. //For perk PipeDealer
  70. bool pPipeDealer[MAXPLAYERS + 1] = false;
  71. int vAlreadyPipes[MAXPLAYERS + 1] = 0;
  72. int vLvLPipes[MAXPLAYERS + 1] = 1;
  73. int vMaxLvLPipes = 5;
  74. Handle vTimeResetPipe[MAXPLAYERS + 1];
  75. Handle hTimerResetPipe[MAXPLAYERS + 1];
  76. bool vPipeIndixite[MAXPLAYERS + 1] = false;
  77. //
  78.  
  79. //Helping Hand
  80. float m_flReviveTime;
  81. float m_flHealTime;
  82. //
  83.  
  84. //Craft And Scav
  85. bool iMinecraft[MAXPLAYERS + 1] = false;
  86. int iCountMedkits[MAXPLAYERS + 1];
  87. int iCraftedMedkits[MAXPLAYERS+1];
  88. Handle vKillTimer[2048+1] = null;
  89. int iKittyCat[2048+1]
  90.  
  91. int iCountAdrenalins[MAXPLAYERS + 1] = 0;
  92. int iCraftedAdrenalins[MAXPLAYERS + 1] = 0;
  93.  
  94. int iCountPills[MAXPLAYERS + 1] = 0;
  95. int iCraftedPills[MAXPLAYERS + 1] = 0;
  96.  
  97. int iCountDebifs[MAXPLAYERS + 1] = 0;
  98. int iCraftedDebifs[MAXPLAYERS + 1] = 0;
  99.  
  100. int iCountGnomes[MAXPLAYERS + 1] = 0;
  101. int iCraftedGnomes[MAXPLAYERS + 1] = 0;
  102.  
  103. int iEveryOneAdrenalins = 0;
  104. int iEveryOnePills = 0;
  105. int iEveryOneMedkit = 0;
  106. int iEveryOneDeffibrilator = 0;
  107. int iEveryOneGnome = 0;
  108.  
  109. //for Fast Reload(thanks to Alaina & tPoncho)
  110. bool FastReload[MAXPLAYERS + 1] = false;
  111. int iPlayRate, iTimeIdle, iNextAt, iNextPrimaryAt, iVMStartTime, iViewModel, iActiveW, iShotStart, iShotInsert, iShotEndDur, iReloadState;
  112. static float g_flSoHAutoS = 0.666666;
  113. static float g_flSoHAutoI = 0.4;
  114. static float g_flSoHAutoE = 0.675;
  115. static float g_flSoHSpasS = 0.5;
  116. static float g_flSoHSpasI = 0.375;
  117. static float g_flSoHSpasE = 0.699999;
  118. static float g_flSoHPumpS = 0.5;
  119. static float g_flSoHPumpI = 0.5;
  120. static float g_flSoHPumpE = 0.6;
  121. int iWeaponData[MAXPLAYERS + 1];
  122. float flRate = 0.6;
  123. //
  124.  
  125. bool ShoveDamage[MAXPLAYERS + 1] = false;
  126.  
  127. //Epic Molik
  128. bool TripleMolotov[MAXPLAYERS + 1] = false;
  129. int iMaxLevelMolo = 6;
  130. int iCountOfMoliks[MAXPLAYERS + 1] = 1;
  131. Handle vCoolDown[MAXPLAYERS + 1] = null;
  132. //
  133.  
  134. bool FakeAdrenaline[MAXPLAYERS + 1] = false;
  135. bool SpeedUp[MAXPLAYERS + 1] = false;
  136. bool DoubleJump[MAXPLAYERS + 1] = false;
  137. bool AntiDamage[MAXPLAYERS + 1] = false;
  138. bool MeleeDamageUp[MAXPLAYERS + 1] = false;
  139.  
  140. Handle vHealUpTeam = null;
  141. Handle vPoisonTeam = null;
  142. Handle vTimerAdver[MAXPLAYERS+1] = null;
  143.  
  144. Handle vRoatation = null;
  145.  
  146. Handle sdkActivatePipe;
  147.  
  148. int g_iHookCreate;
  149.  
  150. char sMap[64];
  151.  
  152. public void OnPluginStart()
  153. {
  154.     Handle hGameConf = LoadGameConfigFile("pipe_bomb");
  155.     if( hGameConf == null )
  156.         SetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
  157.     StartPrepSDKCall(SDKCall_Static);
  158.     if( PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CPipeBombProjectile_Create") == false )
  159.         SetFailState("Could not load the \"CPipeBombProjectile_Create\" gamedata signature.");
  160.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  161.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  162.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  163.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  164.     PrepSDKCall_AddParameter(SDKType_CBasePlayer, SDKPass_Pointer);
  165.     PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain);
  166.     PrepSDKCall_SetReturnInfo(SDKType_CBaseEntity, SDKPass_Pointer);
  167.     sdkActivatePipe = EndPrepSDKCall();
  168.     if( sdkActivatePipe == null )
  169.         SetFailState("Could not prep the \"CPipeBombProjectile_Create\" function.");
  170.    
  171.     RegConsoleCmd("sm_up", BuyMenu);
  172.     RegConsoleCmd("sm_cr", CraftMenu);
  173.     RegAdminCmd("sm_gm", Gm, ADMFLAG_ROOT);
  174.    
  175.     iPlayRate   =   FindSendPropInfo("CBaseCombatWeapon","m_flPlaybackRate");
  176.     iTimeIdle   =   FindSendPropInfo("CTerrorGun","m_flTimeWeaponIdle");
  177.     iNextAt =   FindSendPropInfo("CTerrorPlayer","m_flNextAttack");
  178.     iNextPrimaryAt  =   FindSendPropInfo("CBaseCombatWeapon","m_flNextPrimaryAttack");
  179.     iVMStartTime    =   FindSendPropInfo("CTerrorViewModel","m_flLayerStartTime");
  180.     iViewModel  =   FindSendPropInfo("CTerrorPlayer","m_hViewModel");
  181.     iActiveW    =   FindSendPropInfo("CBaseCombatCharacter","m_hActiveWeapon");
  182.     iShotStart  =   FindSendPropInfo("CBaseShotgun","m_reloadStartDuration");
  183.     iShotInsert =   FindSendPropInfo("CBaseShotgun","m_reloadInsertDuration");
  184.     iShotEndDur     =   FindSendPropInfo("CBaseShotgun","m_reloadEndDuration");
  185.     iReloadState = FindSendPropInfo("CBaseShotgun","m_reloadState");
  186.    
  187.     HookEvent("player_spawn", EventPlayerSpawn);
  188.     HookEvent("survivor_rescued", EventRescue);
  189.     HookEvent("infected_death", EventInfDeath);
  190.     HookEvent("player_death", EventDeath);
  191.     HookEvent("defibrillator_used", EventDefib);
  192.     HookEvent("player_shoved", EventPlayerShove);
  193.     HookEvent("entity_shoved", EventShove);
  194.     HookEvent("revive_begin", EventRevieve, EventHookMode_Pre);
  195.     HookEvent("heal_begin", EventHeal, EventHookMode_Pre);
  196.     HookEvent("witch_killed", EventWitchKill);
  197.     HookEvent("grenade_bounce", EventBounce);
  198.     HookEvent("weapon_reload", EventReload,  EventHookMode_Pre);
  199.     HookEvent("molotov_thrown", EventThrow);
  200.  
  201.     m_flReviveTime = GetConVarFloat(FindConVar("survivor_revive_duration"));
  202.     m_flHealTime = GetConVarFloat(FindConVar("first_aid_kit_use_duration"));
  203.    
  204.     ResetEveryMap = CreateConVar("vHardReset","0",  "Каждую карту будет сброс перков и денег? (>1 - Да, 0 - Нет)", FCVAR_NONE);
  205.    
  206.     CostHelpingHand = CreateConVar("vCostHelpHand","16000", "Стоимость перка Helping Hand", FCVAR_NONE);
  207.     CostDoubleJump = CreateConVar("vCostDoubleJump","14000",    "Стоимость перка Double Jump", FCVAR_NONE);
  208.     CostSpeedUp = CreateConVar("vCostSpeedUp","18000",  "Стоимость перка Speed Up", FCVAR_NONE);
  209.     CostAntiDamage = CreateConVar("vCostAntiDamage","10000",    "Стоимость перка Anti Damage", FCVAR_NONE);
  210.     CostMeleeDamage = CreateConVar("vCostMeleeDamage","14000",  "Стоимость перка Melee Damage", FCVAR_NONE);
  211.     CostFastReload = CreateConVar("vCostFastReload","17500",    "Стоимость перка Fast Reload", FCVAR_NONE);
  212.    
  213.     CostExpAmmoPack = CreateConVar("vCostExpAmmoPack","3500",   "Стоимость осколочных патронов Pack", FCVAR_NONE);
  214.     CostIncAmmoPack = CreateConVar("vCostIncAmmoPack","3500",   "Стоимость зажигательных патронов Pack", FCVAR_NONE);
  215.     CostExpAmmo = CreateConVar("vCostExpAmmo","3000",   "Стоимость осколочных патронов", FCVAR_NONE);
  216.     CostIncAmmo = CreateConVar("vCostIncAmmo","3000",   "Стоимость зажигательных патронов", FCVAR_NONE);
  217.     CostLaserSight = CreateConVar("vCostLaserSight","2000", "Стоимость лазера", FCVAR_NONE);
  218.  
  219.     CostEpicMoli = CreateConVar("vCostEpicMolo","17000",    "Стоимость перка Epic Moli", FCVAR_NONE);
  220.     CostEpicMoliUpgrade = CreateConVar("vCostEpicMoloUpgrade","3500",   "Стоимость апгрейда перка Epic Moli", FCVAR_NONE);
  221.  
  222.     NeedToCraftGnome = CreateConVar("vNumberToCraftGnome","60", "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
  223.     NeedToCraftDefib = CreateConVar("vNumberToCraftDefib","30", "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
  224.     NeedToCraftAdrenaline = CreateConVar("vNumberToCraftAdrenaline","10",   "Сколько нужно частей чтобы скрафтить адреналин", FCVAR_NONE);
  225.     NeedToCraftPills = CreateConVar("vNumberToCraftPills","10", "Сколько нужно частей чтобы скрафтить таблетки", FCVAR_NONE);
  226.     NeedToCraftMedkit = CreateConVar("vNumberToCraftMedkit","20",   "Сколько нужно частей чтобы скрафтить аптечку", FCVAR_NONE);
  227.     ChanceMedkit = CreateConVar("vChanceToDropPart","20",   "Шанс выпадения частицы аптечки из заражённного ", FCVAR_NONE);
  228.     ChancePills = CreateConVar("vChanceToDropPills","20",   "Шанс выпадения частицы таблеток из заражённного ", FCVAR_NONE);
  229.     ChanceAdrenaline = CreateConVar("vChanceToDropAdrenaline","20", "Шанс выпадения частицы адреналина из заражённного ", FCVAR_NONE);
  230.     ChanceToDropDefib = CreateConVar("vChanceToDropDefib","20", "Шанс выпадения частицы дефиба из заражённного ", FCVAR_NONE);
  231.     ChanceToDropGnome = CreateConVar("vChanceToDropDwarf","20", "Шанс выпадения частицы гнома из заражённного ", FCVAR_NONE);
  232.  
  233.     CostMinecraft = CreateConVar("vCostCraftPerk","11000",  "Стоимость перка Craft", FCVAR_NONE);
  234.     CostUpgradePipe = CreateConVar("vCostUpgradePipe","2500",   "Стоимость апгрейда перка Ultra Pipe Bomb", FCVAR_NONE);
  235.     CostUltraPipe = CreateConVar("vCostUltraPipe","20000",  "Стоимость перка Ultra Pipe", FCVAR_NONE);
  236.     CostPipeIndixite = CreateConVar("vCostStickyPipes","250",   "Стоимость перка Sticky Pipes", FCVAR_NONE);
  237.     CostShoveDamage = CreateConVar("vCostPerfectDamage","12999",    "Стоимость перка Perfect Shove", FCVAR_NONE);
  238.    
  239.     iColorDefib = CreateConVar("vGlowCraftDefibColor","66 66 66",   "Цвет глоу для выпадаемых предметов из заражённых", FCVAR_NONE);
  240.     iColorDwarf = CreateConVar("vGlowCraftDwatfColor","0 0 255",    "Цвет глоу для выпадаемых предметов из заражённых", FCVAR_NONE);
  241.  
  242.     iColorAdrenalineCraft = CreateConVar("vGlowCraftAdrenalineColor","93 2 240",    "Цвет глоу для выпадаемых предметов из заражённых", FCVAR_NONE);
  243.     iColorPillsCraft = CreateConVar("vGlowCraftPillsColor","242 27 235",    "Цвет глоу для выпадаемых предметов из заражённых", FCVAR_NONE);
  244.     iYourColor = CreateConVar("vGlowCraftThingsColor","255 0 0",    "Цвет глоу для выпадаемых предметов из заражённых", FCVAR_NONE);
  245.     yourColor = CreateConVar("vGlowPipeColor","255 255 255",    "Цвет глоу для пайпы", FCVAR_NONE);
  246.     AutoExecConfig(true, "[L4D2]Skills");
  247.     LoadTranslations("[L4D2]SkillTr.phrases");
  248. }
  249.  
  250. public void OnMapStart()
  251. {
  252.     iSprite = PrecacheModel(BEAMSPRITE)
  253.     iHalo = PrecacheModel(BEAMHALO);
  254.     PrecacheModel(iMedkit);
  255.     if(GetConVarInt(ResetEveryMap) == 0)
  256.     {
  257.         GetCurrentMap(sMap, sizeof(sMap))
  258.         if(StrContains(sMap, "m1_", true) > 1)
  259.         {
  260.             for(int i = 1; i <= MaxClients; ++i)
  261.             {
  262.                 Cash[i] = 0;
  263.                 TeamCash = 5000;
  264.                 CI[i] = 0;
  265.    
  266.                 if(vTimerAdver[i] != null)
  267.                 {
  268.                     KillTimer(vTimerAdver[i])
  269.                     vTimerAdver[i] = null;
  270.                 }
  271.                 iCountAdrenalins[i] = 0;
  272.                 iCraftedAdrenalins[i] = 0;
  273.                 iCountPills[i] = 0;
  274.                 iCraftedPills[i] = 0;
  275.                 iCountMedkits[i] = 0;
  276.                 iCraftedMedkits[i] = 0;
  277.                 FastReload[i] = false;
  278.                 vLvLPipes[i] = 1;
  279.                 vPipeIndixite[i] = false;
  280.                 pPipeDealer[i] = false;
  281.                 ShoveDamage[i] = false;
  282.                 FakeAdrenaline[i] = false;
  283.                 DoubleJump[i] = false;
  284.                 SpeedUp[i] = false;
  285.                 AntiDamage[i] = false
  286.                 MeleeDamageUp[i] = false;
  287.                 iMinecraft[i] = false;
  288.                 TripleMolotov[i] = false
  289.             }
  290.             if(vHealUpTeam != null)
  291.             {
  292.                 KillTimer(vHealUpTeam)
  293.                 vHealUpTeam = null;
  294.             }
  295.         }
  296.     }
  297.     else
  298.     {
  299.         for(int i = 1; i <= MaxClients; ++i)
  300.         {
  301.             Cash[i] = 0;
  302.             TeamCash = 5000;
  303.             CI[i] = 0;
  304.    
  305.             if(vTimerAdver[i] != null)
  306.             {
  307.                 KillTimer(vTimerAdver[i])
  308.                 vTimerAdver[i] = null;
  309.             }
  310.             iCountAdrenalins[i] = 0;
  311.             iCraftedAdrenalins[i] = 0;
  312.             iCountPills[i] = 0;
  313.             iCraftedPills[i] = 0;
  314.             TripleMolotov[i] = false;
  315.             iCraftedMedkits[i] = 0;
  316.             iCountMedkits[i] = 0;
  317.             iMinecraft[i] = false;
  318.             FastReload[i] = false;
  319.             vLvLPipes[i] = 1;
  320.             vPipeIndixite[i] = false;
  321.             pPipeDealer[i] = false;
  322.             ShoveDamage[i] = false;
  323.             FakeAdrenaline[i] = false;
  324.             DoubleJump[i] = false;
  325.             SpeedUp[i] = false;
  326.             AntiDamage[i] = false
  327.             MeleeDamageUp[i] = false;
  328.         }
  329.         if(vHealUpTeam != null)
  330.         {
  331.             KillTimer(vHealUpTeam)
  332.             vHealUpTeam = null;
  333.         }
  334.     }
  335.     if(vPoisonTeam != null)
  336.     {
  337.         KillTimer(vPoisonTeam)
  338.         vPoisonTeam = null;
  339.     }
  340. }
  341.  
  342. public Action CraftMenu(int client, int args)
  343. {
  344.     if(bIsSurvivor(client))
  345.     {
  346.         DisplayCraftMenu(client)
  347.     }
  348. }
  349.  
  350. public Action EventPlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
  351. {
  352.     int client = GetClientOfUserId(GetEventInt(event, "userid"));
  353.     if(bIsSurvivor(client) && SpeedUp[client])
  354.     {
  355.         SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2)
  356.         SetEntityGravity(client, 0.8);
  357.     }
  358. }
  359.  
  360. //Thanks to Silvers!
  361. public Action EventThrow(Handle event, const char[] name, bool dontBroadcast)
  362. {
  363.     // Only capture 1 throw per frame, do not capture our secondary created grenades.
  364.     if( g_iHookCreate == 0)
  365.     {
  366.         // Validate client
  367.         int client = GetClientOfUserId(GetEventInt(event, "userid"));
  368.         if( client && IsClientInGame(client) && TripleMolotov[client] && vCoolDown[client] == null)
  369.         {
  370.             // Find projectile
  371.             int entity = INVALID_ENT_REFERENCE;
  372.             while( (entity = FindEntityByClassname(entity, "molotov_projectile")) != INVALID_ENT_REFERENCE )
  373.             {
  374.                 // Verify we have not already created multiple grenades for this and belongs to our thrower
  375.                 if( GetEntProp(entity, Prop_Data, "m_iHammerID") == 0 && GetEntPropEnt(entity, Prop_Data, "m_hThrower") == client )
  376.                 {
  377.                     // To show this grenade has been handled, prevent handling wrong ones.
  378.                     SetEntProp(entity, Prop_Data, "m_iHammerID", 1);
  379.  
  380.                     // Position to create
  381.                     float vPos[3];
  382.                     GetEntPropVector(entity, Prop_Data, "m_vecAbsOrigin", vPos);
  383.  
  384.                     // Listen for projectile creations, set as master projectile entity
  385.                     g_iHookCreate = EntIndexToEntRef(entity);
  386.                     iCountOfMoliks[client]++
  387.                     // Number of projectiles we're creating.
  388.                     for( int i = 1; i <= iCountOfMoliks[client]; i++ )
  389.                     {
  390.                         // Create molotov projectile with VScript. SDKCall fails, signature too long, CreateEntityByName doesn't 'Activate' the grenade.
  391.                         L4D2_RunScript("DropFire(Vector(%f %f %f))", vPos[0], vPos[1], vPos[2]);
  392.                     }
  393.                     vCoolDown[client] = CreateTimer(20.0, iCoolDown, client)
  394.                     iCountOfMoliks[client]--;
  395.                     g_iHookCreate = 0;
  396.                 }
  397.             }
  398.         }
  399.     }
  400. }
  401.  
  402. public Action iCoolDown(Handle timer, int client)
  403. {
  404.     Client_PrintToChat(client, true, "%t", "MolotovCoolDownFinished")
  405.     vCoolDown[client] = null;
  406. }
  407.  
  408. //Thanks to Silvers!
  409. public void SpawnPost(int entity)
  410. {
  411.     // Must wait for frame after spawn to teleport
  412.     RequestFrame(nextFrame, EntIndexToEntRef(entity));
  413. }
  414.  
  415. //Thanks to Silvers!
  416. public void nextFrame(int entity)
  417. {
  418.     if( (entity = EntRefToEntIndex(entity)) != INVALID_ENT_REFERENCE )
  419.     {
  420.         // Get our master projectile entity index
  421.         int grenade = GetEntProp(entity, Prop_Data, "m_iHammerID");
  422.         if( grenade != INVALID_ENT_REFERENCE )
  423.         {
  424.             float vPos[3], vAng[3], vVel[3];
  425.             GetEntPropVector(grenade, Prop_Data, "m_angRotation", vAng);
  426.             GetEntPropVector(grenade, Prop_Data, "m_vecAbsOrigin", vPos);
  427.             GetEntPropVector(grenade, Prop_Send, "m_vInitialVelocity", vVel);
  428.             int client = GetEntPropEnt(grenade, Prop_Data, "m_hThrower");
  429.  
  430.             float vDir[3];
  431.             GetAngleVectors(vAng, vDir, NULL_VECTOR, NULL_VECTOR);
  432.             vAng[0] += GetRandomFloat(-20.0, 20.0);
  433.             vAng[1] += GetRandomFloat(-20.0, 20.0);
  434.             vAng[2] += GetRandomFloat(-20.0, 20.0);
  435.             vPos[0] += GetRandomFloat(-20.0, 20.0);
  436.             vPos[1] += GetRandomFloat(-20.0, 20.0);
  437.             vPos[2] += GetRandomFloat(-20.0, 20.0);
  438.             vVel[0] += GetRandomFloat(-100.0, 100.0);
  439.             vVel[1] += GetRandomFloat(-100.0, 100.0);
  440.             vVel[2] += GetRandomFloat(-100.0, 100.0);
  441.             TeleportEntity(entity, vPos, vAng, vVel);
  442.             SetEntPropEnt(entity, Prop_Data, "m_hThrower", client);
  443.         }
  444.     }
  445. }
  446.  
  447. //Thanks to Silvers!
  448. /**
  449. * Runs a single line of VScript code.
  450. * NOTE: Dont use the "script" console command, it starts a new instance and leaks memory. Use this instead!
  451. *
  452. * @param sCode        The code to run.
  453. * @noreturn
  454. */
  455. stock void L4D2_RunScript(char[] sCode, any ...)
  456. {
  457.     static int iScriptLogic = INVALID_ENT_REFERENCE;
  458.     if( iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic) )
  459.     {
  460.         iScriptLogic = EntIndexToEntRef(CreateEntityByName("logic_script"));
  461.         if( iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic) )
  462.             SetFailState("Could not create 'logic_script'");
  463.  
  464.         DispatchSpawn(iScriptLogic);
  465.     }
  466.  
  467.     char sBuffer[64];
  468.     VFormat(sBuffer, sizeof(sBuffer), sCode, 2);
  469.  
  470.     SetVariantString(sBuffer);
  471.     AcceptEntityInput(iScriptLogic, "RunScriptCode");
  472. }
  473.  
  474. public Action EventReload(Event event, const char[] name, bool dontBroadcast)
  475. {
  476.     int client = GetClientOfUserId(GetEventInt(event, "userid"));
  477.    
  478.     if(FastReload[client])
  479.     {
  480.         char sWeaponName[64];
  481.         int iWeapon = GetEntDataEnt2(client, iActiveW);
  482.         GetClientWeapon(client, sWeaponName, sizeof(sWeaponName));
  483.         iWeaponData[client] = iWeapon;
  484.         if(StrContains(sWeaponName, "shotgun") < 1)
  485.         {
  486.             MagStart(iWeapon, client)
  487.         }
  488.         else if (StrContains(sWeaponName,"autoshotgun",false) != -1)
  489.         {
  490.             CreateTimer(0.1, Autoshotgun, client);
  491.         }
  492.         else if (StrContains(sWeaponName,"shotgun_spas",false) != -1)
  493.         {
  494.             CreateTimer(0.1, SpasShotgun, client);
  495.         }
  496.         else if (StrContains(sWeaponName,"pumpshotgun",false) != -1
  497.                 || StrContains(sWeaponName,"shotgun_chrome",false) != -1)
  498.         {
  499.             CreateTimer(0.1, Pumpshotgun, client);
  500.         }
  501.     }
  502.     return Plugin_Continue;
  503. }
  504.  
  505. public Action Autoshotgun(Handle timer, int iClient)
  506. {
  507.     KillTimer(timer);
  508.     if (IsServerProcessing()==false)
  509.         return Plugin_Stop;
  510.  
  511.     int iWeapon = iWeaponData[iClient];
  512.     if (iClient <= 0
  513.         || iWeapon <= 0
  514.         || IsValidEntity(iClient)==false
  515.         || IsValidEntity(iWeapon)==false
  516.         || IsClientInGame(iClient)==false)
  517.         return Plugin_Stop;
  518.  
  519.     SetEntDataFloat(iWeapon,    iShotStart, g_flSoHAutoS*flRate,    true);
  520.     SetEntDataFloat(iWeapon,    iShotInsert,    g_flSoHAutoI*flRate,    true);
  521.     SetEntDataFloat(iWeapon,    iShotEndDur,        g_flSoHAutoE*flRate,    true);
  522.    
  523.     SetEntDataFloat(iWeapon, iPlayRate, 1.0/flRate, true);
  524.  
  525.     CreateTimer(0.3, ShotgunEnd, iClient, TIMER_REPEAT);
  526.  
  527.     return Plugin_Stop;
  528. }
  529.  
  530. public Action Pumpshotgun (Handle timer, int iClient)
  531. {
  532.     KillTimer(timer);
  533.     if (!IsServerProcessing())
  534.         return Plugin_Stop;
  535.  
  536.     int iWeapon = iWeaponData[iClient];
  537.  
  538.     if (iClient <= 0
  539.         || iWeapon <= 0
  540.         || IsValidEntity(iClient)==false
  541.         || IsValidEntity(iWeapon)==false
  542.         || IsClientInGame(iClient)==false)
  543.         return Plugin_Stop;
  544.  
  545.     SetEntDataFloat(iWeapon,    iShotStart, g_flSoHPumpS*flRate,    true);
  546.     SetEntDataFloat(iWeapon,    iShotInsert,    g_flSoHPumpI*flRate,    true);
  547.     SetEntDataFloat(iWeapon,    iShotEndDur,        g_flSoHPumpE*flRate,    true);
  548.  
  549.     SetEntDataFloat(iWeapon, iPlayRate, 1.0/flRate, true);
  550.  
  551.  
  552.     CreateTimer(0.3, ShotgunEnd, iClient, TIMER_REPEAT);
  553.     return Plugin_Stop;
  554. }
  555.  
  556. public Action SpasShotgun (Handle timer, int iClient)
  557. {
  558.     KillTimer(timer);
  559.     if (IsServerProcessing()==false)
  560.         return Plugin_Stop;
  561.  
  562.     int iWeapon = iWeaponData[iClient];
  563.  
  564.     if (iClient <= 0
  565.         || iWeapon <= 0
  566.         || IsValidEntity(iClient)==false
  567.         || IsValidEntity(iWeapon)==false
  568.         || IsClientInGame(iClient)==false)
  569.         return Plugin_Stop;
  570.  
  571.     SetEntDataFloat(iWeapon,    iShotStart, g_flSoHSpasS*flRate,    true);
  572.     SetEntDataFloat(iWeapon,    iShotInsert,    g_flSoHSpasI*flRate,    true);
  573.     SetEntDataFloat(iWeapon,    iShotEndDur,        g_flSoHSpasE*flRate,    true);
  574.  
  575.     SetEntDataFloat(iWeapon, iPlayRate, 1.0/flRate, true);
  576.  
  577.     CreateTimer(0.3, ShotgunEnd, iClient, TIMER_REPEAT);
  578.  
  579.     return Plugin_Stop;
  580. }
  581.  
  582. public Action ShotgunEnd (Handle timer, int iClient)
  583. {
  584.     int iWeapon = iWeaponData[iClient];
  585.    
  586.     if (iWeapon < 0)return Plugin_Stop;
  587.    
  588.     if (!IsServerProcessing() && !bIsSurvivor(iClient))
  589.     {
  590.         KillTimer(timer);
  591.         return Plugin_Stop;
  592.     }
  593.  
  594.     if (GetEntData(iWeapon, iReloadState) == 0)
  595.     {
  596.         SetEntDataFloat(iWeapon, iPlayRate, 1.0, true);
  597.  
  598.         float flTime=GetGameTime()+0.2;
  599.         SetEntDataFloat(iClient, iNextAt, flTime, true);
  600.         SetEntDataFloat(iWeapon, iTimeIdle, flTime, true);
  601.         SetEntDataFloat(iWeapon, iNextPrimaryAt, flTime, true);
  602.  
  603.         KillTimer(timer);
  604.         return Plugin_Stop;
  605.     }
  606.  
  607.     return Plugin_Continue;
  608. }
  609.  
  610. public Action EventRescue(Event event, const char[] name, bool dontBroadcast)
  611. {
  612.     int client = GetClientOfUserId(GetEventInt(event, "subject"));
  613.  
  614.     if(SpeedUp[client])
  615.     {
  616.         SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2)
  617.         SetEntityGravity(client, 0.8);
  618.     }
  619. }
  620.  
  621. public void OnEntityCreated(int entity, const char[] classname)
  622. {
  623.     if(IsPipe(entity))
  624.     {
  625.         CreateTimer(0.1, OnHeSpawned, EntIndexToEntRef(entity), TIMER_FLAG_NO_MAPCHANGE);
  626.     }
  627.     if( g_iHookCreate && strcmp(classname, "molotov_projectile") == 0)
  628.     {
  629.         // Save master projectile entity index for position, angle, velocity.
  630.         int grenade = EntRefToEntIndex(g_iHookCreate);
  631.         if( grenade != INVALID_ENT_REFERENCE )
  632.         {
  633.             SetEntProp(entity, Prop_Data, "m_iHammerID", g_iHookCreate);
  634.  
  635.             // Have to wait for the projectile to be fully spawned before we can teleport.
  636.             SDKHook(entity, SDKHook_SpawnPost, SpawnPost);
  637.         }
  638.     }
  639. }
  640.  
  641. public Action OnHeSpawned(Handle timer, any ent)
  642. {
  643.     int client;
  644.     if((ent = EntRefToEntIndex(ent)) > 0 && (client = GetEntPropEnt(ent, Prop_Data, "m_hThrower")) > 0)
  645.     {
  646.         if(vPipeIndixite[client])
  647.         {
  648.             SDKHook(ent, SDKHook_Touch, OnTouchPost);
  649.         }
  650.     }
  651. }
  652.  
  653. public Action OnTouchPost(int iGrenade, int iOther)
  654. {
  655.     if (!iOther)
  656.     {
  657.         SetEntityMoveType(iGrenade, MOVETYPE_NONE);
  658.     }
  659.     else if ((iOther > MaxClients) && (GetEntProp(iOther, Prop_Send, "m_nSolidType", 1) && !(GetEntProp(iOther, Prop_Send, "m_usSolidFlags", 2) & 0x0004)))
  660.     {
  661.         SetEntityMoveType(iGrenade, MOVETYPE_NONE);
  662.     }
  663.     if(IsValidClient(iOther) || IsCommonInfected(iOther) || IsWitch(iOther))
  664.     {
  665.         SetEntityMoveType(iGrenade, MOVETYPE_NONE);
  666.         SetVariantString("!activator");
  667.         AcceptEntityInput(iGrenade, "SetParent", iOther);
  668.     }
  669. }
  670.  
  671. public bool Trace_Filter_Not_Self(int entity,int mask, any data)
  672. {
  673.     if(entity == data)
  674.         return false;
  675.     return true;
  676. }  
  677.  
  678. public Action EventBounce(Event event, const char[] name, bool dontBroadcast)
  679. {
  680.     int client = GetClientOfUserId(GetEventInt(event, "userid"));
  681.     int grenade = GetGrenade(client);
  682.  
  683.     if(IsPipe(grenade))
  684.     {  
  685.         float vAng[3], vec[3], HeadingVector[3], AimVector[3], current[3] , gPos[3];
  686.         float power = 250.0;
  687.         if(pPipeDealer[client])
  688.         {
  689.             if(bIsSurvivor(client))
  690.             {
  691.                 if(vTimeResetPipe[client] == null)
  692.                 {
  693.                     if(vAlreadyPipes[client] < vLvLPipes[client])
  694.                     {
  695.                         GetEntPropVector(grenade, Prop_Send, "m_vecOrigin", gPos);
  696.                         GetEntPropVector(grenade, view_as<PropType>(1), "m_vecVelocity", vec, 0);
  697.                         GetClientEyeAngles(client, HeadingVector);
  698.                         AimVector[0] = Cosine(DegToRad(HeadingVector[1])) * power * GetRandomInt(1, 5);
  699.                         AimVector[1] = Sine(DegToRad(HeadingVector[1])) * power * GetRandomInt(1, 5);
  700.                         gPos[2] += 15.0;
  701.                         vec[2] += 40.0;
  702.                         vec[0] += 30.0;
  703.                         vec[1] += 5.0;
  704.                         current[0] = vec[0] + AimVector[0];
  705.                         current[1] = vec[1] + AimVector[1];
  706.                         current[2] = power * 2;
  707.                         int entity = SDKCall(sdkActivatePipe, gPos, vAng, vAng, vAng, client, 15.0);
  708.                         SetEntProp(entity, Prop_Send, "m_nSolidType", 1);
  709.                         TeleportEntity(entity, gPos, NULL_VECTOR, current);
  710.                         int ParticleEntity = CreateEntityByName("info_particle_system");
  711.                         DispatchKeyValueFloat(entity, "fademindist", -1.0);
  712.                         DispatchKeyValueFloat(entity, "fademindist", 999.0);
  713.                         DispatchKeyValue(ParticleEntity, "effect_name", PARTICLE_LIGHT);
  714.                         DispatchKeyValue(ParticleEntity, "effect_name", PARTICLE_FUSE);
  715.                         DispatchSpawn(ParticleEntity);
  716.                         SetEntProp(entity, Prop_Send, "m_CollisionGroup", 0);
  717.                         SetEntProp(entity, Prop_Send, "m_nGlowRange", 2000);
  718.                         SetEntProp(entity, Prop_Send, "m_iGlowType", 3);
  719.                         SetEntProp(entity, Prop_Send, "m_glowColorOverride", GetColor(yourColor));
  720.                        
  721.                         SetEntProp(grenade, Prop_Send, "m_CollisionGroup", 0);
  722.                         SetEntProp(grenade, Prop_Send, "m_nGlowRange", 2000);
  723.                         SetEntProp(grenade, Prop_Send, "m_iGlowType", 3);
  724.                         SetEntProp(grenade, Prop_Send, "m_glowColorOverride", GetColor(yourColor));
  725.                         ActivateEntity(ParticleEntity);
  726.                         AcceptEntityInput(ParticleEntity, "Start");
  727.                         vAlreadyPipes[client]++;
  728.                     }
  729.                     else
  730.                     {
  731.                         if(hTimerResetPipe[client] == null)
  732.                         {
  733.                             hTimerResetPipe[client] = CreateTimer(20.0, vTimerResetPipe, client)
  734.                         }
  735.                     }
  736.                 }
  737.             }
  738.         }
  739.     }
  740. }
  741.  
  742. public Action vTimerResetPipe(Handle timer, int client)
  743. {
  744.     Client_PrintToChat(client, true, "%t", "UltraPipeBombCooldownFinish")
  745.     //Client_PrintToChat(client, true, "{O}Ваш{G} перк{R}(Пайпо Мёт){BLA}откуладунился.")
  746.     vAlreadyPipes[client] = 0;
  747.     KillTimer(hTimerResetPipe[client])
  748.     hTimerResetPipe[client] = null;
  749. }
  750.  
  751. public Action vTimeCashTeam(Handle timer)
  752. {
  753.     int ForwardingCash = RoundToCeil(TeamCash * 1.1);
  754.     TeamCash = ForwardingCash;
  755. }
  756.  
  757. public Action EventWitchKill(Event event, const char[] name, bool dontBroadcast)
  758. {
  759.     int attacker = GetClientOfUserId(GetEventInt(event,"userid"));
  760.  
  761.     if(bIsSurvivor(attacker))
  762.     {
  763.         int random = GetRandomInt(250, 2500) * 2;
  764.         Cash[attacker] +=  random
  765.         Client_PrintToChat(attacker, true, "%t", "WitchKilled", random)
  766.         for(int i = 1; i <= MaxClients; ++i)
  767.         {
  768.             if(IsClientInGame(i) && i != attacker)
  769.             {
  770.                 Client_PrintToChat(i, true, "%t", "WhoWitchKilled", attacker, random)
  771.             }
  772.         }
  773.         //Client_PrintToChat(attacker, true, "{BLA}Вы {R}получили {OG}%i {R}за убийство {OG}бабы.", random)
  774.     }
  775. }
  776.  
  777.  
  778. public Action EventInfDeath(Event event, const char[] name, bool dontBroadcast)
  779. {
  780.     int attacker = GetClientOfUserId(GetEventInt(event,"attacker"));
  781.  
  782.     if(vTimerAdver[attacker] == null)
  783.     {
  784.         vTimerAdver[attacker] = CreateTimer(70.0, Advertisement, attacker)
  785.     }
  786.     CI[attacker]++;        
  787. }
  788.  
  789. public Action Advertisement(Handle timer, int attacker)
  790. {
  791.     int total = GetRandomInt(0, 30) * CI[attacker] * GetRandomInt(1, 3)
  792.     if(bIsSurvivor(attacker) && total != 1702257729 && CI[attacker] != 1702257729)
  793.     {
  794.         Client_PrintToChat(attacker, true, "%t", "AdvertisementHowManyCommonsKilled", total, CI[attacker])
  795.         //Client_PrintToChat(attacker, true, "{BLA}Вы {R}получили {OG}%i {R}за убийство {OG}%i {R}обычных заражённых.", total, CI[attacker])
  796.     }
  797.     Cash[attacker] += total;
  798.     CI[attacker] = 0;
  799.     KillTimer(vTimerAdver[attacker])
  800.     vTimerAdver[attacker] = null;
  801.  
  802. }
  803.  
  804. public Action EventHeal(Event event, const char[] name, bool dontBroadcast)
  805. {
  806.     int i = GetClientOfUserId(GetEventInt(event,"userid"));
  807.     if(FakeAdrenaline[i])
  808.     {
  809.         SetEntProp(i, Prop_Send, "m_bAdrenalineActive", 1, 1)
  810.         SetConVarFloat(FindConVar("first_aid_kit_use_duration"), m_flHealTime * 0.5, false, false);
  811.     }
  812.     else
  813.     {
  814.         SetConVarFloat(FindConVar("first_aid_kit_use_duration"), m_flHealTime, false, false);
  815.     }
  816. }
  817.  
  818. public Action EventRevieve (Event event, const char[] name, bool dontBroadcast)
  819. {
  820.     int i = GetClientOfUserId(GetEventInt(event,"userid"));
  821.     if(FakeAdrenaline[i])
  822.     {
  823.         SetEntProp(i, Prop_Send, "m_bAdrenalineActive", 1, 1)
  824.         SetConVarFloat(FindConVar("survivor_revive_duration"), m_flReviveTime * 0.5, false, false);
  825.     }
  826.     else
  827.     {
  828.         SetConVarFloat(FindConVar("survivor_revive_duration"), m_flReviveTime, false, false);
  829.     }
  830. }
  831.  
  832. public Action EventDeath(Event event, const char[] name, bool dontBroadcast)
  833. {
  834.     int client = GetClientOfUserId(event.GetInt("userid"));
  835.     int attacker = GetClientOfUserId(event.GetInt("attacker"));
  836.     if(bIsSurvivor(client))
  837.     {
  838.         if(SpeedUp[client])
  839.         {
  840.             SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0)
  841.             SetEntityGravity(client, 1.0);
  842.         }
  843.     }
  844.     if(IsValidInfected(client))
  845.     {
  846.         if(bIsSurvivor(attacker))
  847.         {
  848.             int iCase = GetRandomInt(0, 4)
  849.             {
  850.                 switch(iCase)
  851.                 {
  852.                     case 0:
  853.                     {
  854.                         if(GetRandomInt(0, 100) <= GetConVarInt(ChanceMedkit))
  855.                         {
  856.                             float vPos[3]
  857.                             GetEntPropVector(client, Prop_Data, "m_vecOrigin", vPos)
  858.                             vPos[2] += 20.0;
  859.                             int iKit = CreateEntityByName("prop_dynamic_override")
  860.                             if(IsValidEntity(iKit))
  861.                             {
  862.                                 DispatchKeyValueVector(iKit, "origin", vPos );
  863.                                 DispatchKeyValue(iKit, "model", iMedkit);
  864.                                 DispatchSpawn(iKit);
  865.                                
  866.                                 int iTrigger = CreateEntityByName("trigger_multiple");
  867.                                 DispatchKeyValue(iTrigger, "spawnflags", "1");
  868.                                 DispatchKeyValue(iTrigger, "wait", "0");
  869.                                 DispatchSpawn(iTrigger);
  870.                                 ActivateEntity(iTrigger);
  871.                                 TeleportEntity(iTrigger, vPos, NULL_VECTOR, NULL_VECTOR);
  872.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", view_as<float>({-25.0, -25.0, -25.0}));
  873.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", view_as<float>({25.0, 25.0, 25.0}));
  874.                                 SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2);
  875.                                 HookSingleEntityOutput(iTrigger, "OnStartTouch", OnStartTouch);
  876.                                
  877.                                 iKittyCat[iTrigger] = EntIndexToEntRef(iKit)
  878.                                 vRoatation = CreateTimer(0.05, vRotation, EntIndexToEntRef(iKit), TIMER_REPEAT)
  879.                                
  880.                                 int iYourColorRing[4];
  881.                                 iYourColorRing[0] = GetRandomInt(0, 255)
  882.                                 iYourColorRing[1] = GetRandomInt(0, 255)
  883.                                 iYourColorRing[2] = GetRandomInt(0, 255)
  884.                                 iYourColorRing[3] = 255;
  885.                                    
  886.                                 TE_SetupBeamRingPoint(vPos, 120.0, 0.1, iSprite, iHalo, 0, 66, 25.0, 1.7, 2.0, iYourColorRing, 20, 0)
  887.                                 TE_SendToAll();
  888.  
  889.                                 SetEntProp(iKit, Prop_Send, "m_nGlowRange", 500);
  890.                                 SetEntProp(iKit, Prop_Send, "m_iGlowType", 3);
  891.                                 SetEntProp(iKit, Prop_Send, "m_glowColorOverride", GetColor(iYourColor));
  892.                                
  893.                                 DataPack iPack;
  894.                                 vKillTimer[iKit] = CreateDataTimer(25.0, vKill, iPack, TIMER_DATA_HNDL_CLOSE)
  895.                                 WritePackCell(iPack, EntIndexToEntRef(iTrigger));
  896.                                 WritePackCell(iPack, EntIndexToEntRef(iKit));
  897.                             }
  898.                         }
  899.                     }
  900.                     case 1:
  901.                     {
  902.                         if(GetRandomInt(0, 100) <= GetConVarInt(ChancePills))
  903.                         {
  904.                             float vPos[3]
  905.                             GetEntPropVector(client, Prop_Data, "m_vecOrigin", vPos)
  906.                             vPos[2] += 20.0;
  907.                             int iPill = CreateEntityByName("prop_dynamic_override")
  908.                             if(IsValidEntity(iPill))
  909.                             {
  910.                                 DispatchKeyValueVector(iPill, "origin", vPos );
  911.                                 DispatchKeyValue(iPill, "model", iPills);
  912.                                 DispatchSpawn(iPill);
  913.                                
  914.                                 int iTrigger = CreateEntityByName("trigger_multiple");
  915.                                 DispatchKeyValue(iTrigger, "spawnflags", "1");
  916.                                 DispatchKeyValue(iTrigger, "wait", "0");
  917.                                 DispatchSpawn(iTrigger);
  918.                                 ActivateEntity(iTrigger);
  919.                                 TeleportEntity(iTrigger, vPos, NULL_VECTOR, NULL_VECTOR);
  920.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", view_as<float>({-25.0, -25.0, -25.0}));
  921.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", view_as<float>({25.0, 25.0, 25.0}));
  922.                                 SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2);
  923.                                 HookSingleEntityOutput(iTrigger, "OnStartTouch", OnStartTouchPills);
  924.                                
  925.                                 iKittyCat[iTrigger] = EntIndexToEntRef(iPill)
  926.                                 vRoatation = CreateTimer(0.05, vRotation, EntIndexToEntRef(iPill), TIMER_REPEAT)
  927.                                
  928.                                 int iYourColorRing[4];
  929.                                 iYourColorRing[0] = GetRandomInt(0, 255)
  930.                                 iYourColorRing[1] = GetRandomInt(0, 255)
  931.                                 iYourColorRing[2] = GetRandomInt(0, 255)
  932.                                 iYourColorRing[3] = 255;
  933.                                    
  934.                                 TE_SetupBeamRingPoint(vPos, 120.0, 0.1, iSprite, iHalo, 0, 66, 25.0, 1.7, 2.0, iYourColorRing, 20, 0)
  935.                                 TE_SendToAll();
  936.  
  937.                                 SetEntProp(iPill, Prop_Send, "m_nGlowRange", 500);
  938.                                 SetEntProp(iPill, Prop_Send, "m_iGlowType", 3);
  939.                                 SetEntProp(iPill, Prop_Send, "m_glowColorOverride", GetColor(iColorPillsCraft));
  940.                                
  941.                                 DataPack iPack;
  942.                                 vKillTimer[iPill] = CreateDataTimer(25.0, vKill, iPack, TIMER_DATA_HNDL_CLOSE)
  943.                                 WritePackCell(iPack, EntIndexToEntRef(iTrigger));
  944.                                 WritePackCell(iPack, EntIndexToEntRef(iPill));
  945.                             }
  946.                         }
  947.                     }
  948.                     case 2:
  949.                     {
  950.                         if(GetRandomInt(0, 100) <= GetConVarInt(ChanceAdrenaline))
  951.                         {
  952.                             float vPos[3]
  953.                             GetEntPropVector(client, Prop_Data, "m_vecOrigin", vPos)
  954.                             vPos[2] += 20.0;
  955.                             int iA = CreateEntityByName("prop_dynamic_override")
  956.                             if(IsValidEntity(iA))
  957.                             {
  958.                                 DispatchKeyValueVector(iA, "origin", vPos );
  959.                                 DispatchKeyValue(iA, "model", iAdrenaline);
  960.                                 DispatchSpawn(iA);
  961.                                
  962.                                 int iTrigger = CreateEntityByName("trigger_multiple");
  963.                                 DispatchKeyValue(iTrigger, "spawnflags", "1");
  964.                                 DispatchKeyValue(iTrigger, "wait", "0");
  965.                                 DispatchSpawn(iTrigger);
  966.                                 ActivateEntity(iTrigger);
  967.                                 TeleportEntity(iTrigger, vPos, NULL_VECTOR, NULL_VECTOR);
  968.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", view_as<float>({-25.0, -25.0, -25.0}));
  969.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", view_as<float>({25.0, 25.0, 25.0}));  
  970.                                 SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2);
  971.                                 HookSingleEntityOutput(iTrigger, "OnStartTouch", OnStartTouchAdrenaline);
  972.                                
  973.                                 iKittyCat[iTrigger] = EntIndexToEntRef(iA)
  974.                                 vRoatation = CreateTimer(0.05, vRotation, EntIndexToEntRef(iA), TIMER_REPEAT)
  975.                                
  976.                                 int iYourColorRing[4];
  977.                                 iYourColorRing[0] = GetRandomInt(0, 255)
  978.                                 iYourColorRing[1] = GetRandomInt(0, 255)
  979.                                 iYourColorRing[2] = GetRandomInt(0, 255)
  980.                                 iYourColorRing[3] = 255;
  981.                                    
  982.                                 TE_SetupBeamRingPoint(vPos, 120.0, 0.1, iSprite, iHalo, 0, 66, 25.0, 1.7, 2.0, iYourColorRing, 20, 0)
  983.                                 TE_SendToAll();
  984.  
  985.                                 SetEntProp(iA, Prop_Send, "m_nGlowRange", 500);
  986.                                 SetEntProp(iA, Prop_Send, "m_iGlowType", 3);
  987.                                 SetEntProp(iA, Prop_Send, "m_glowColorOverride", GetColor(iColorAdrenalineCraft));
  988.                                
  989.                                 DataPack iPack;
  990.                                 vKillTimer[iA] = CreateDataTimer(25.0, vKill, iPack, TIMER_DATA_HNDL_CLOSE)
  991.                                 WritePackCell(iPack, EntIndexToEntRef(iTrigger));
  992.                                 WritePackCell(iPack, EntIndexToEntRef(iA));
  993.                             }
  994.                         }
  995.  
  996.                     }
  997.                     case 3:
  998.                     {
  999.                         if(GetRandomInt(0, 100) <= GetConVarInt(ChanceToDropDefib))
  1000.                         {
  1001.                             float vPos[3]
  1002.                             GetEntPropVector(client, Prop_Data, "m_vecOrigin", vPos)
  1003.                             vPos[2] += 20.0;
  1004.                             int iDefib = CreateEntityByName("prop_dynamic_override")
  1005.                             if(IsValidEntity(iDefib))
  1006.                             {
  1007.                                 DispatchKeyValueVector(iDefib, "origin", vPos );
  1008.                                 DispatchKeyValue(iDefib, "model", iMoDefib);
  1009.                                 DispatchSpawn(iDefib);
  1010.                                 SetEntityModel(iDefib, iMoDefib)
  1011.  
  1012.                                 int iTrigger = CreateEntityByName("trigger_multiple");
  1013.                                 DispatchKeyValue(iTrigger, "spawnflags", "1");
  1014.                                 DispatchKeyValue(iTrigger, "wait", "0");
  1015.                                 DispatchSpawn(iTrigger);
  1016.                                 ActivateEntity(iTrigger);
  1017.                                 TeleportEntity(iTrigger, vPos, NULL_VECTOR, NULL_VECTOR);
  1018.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", view_as<float>({-25.0, -25.0, -25.0}));
  1019.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", view_as<float>({25.0, 25.0, 25.0}));
  1020.                                 SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2);
  1021.                                 HookSingleEntityOutput(iTrigger, "OnStartTouch", OnStartTouchDefib);
  1022.                                
  1023.                                 iKittyCat[iTrigger] = EntIndexToEntRef(iDefib)
  1024.                                 vRoatation = CreateTimer(0.05, vRotation, EntIndexToEntRef(iDefib), TIMER_REPEAT)
  1025.                                
  1026.                                 int iYourColorRing[4];
  1027.                                 iYourColorRing[0] = GetRandomInt(0, 255)
  1028.                                 iYourColorRing[1] = GetRandomInt(0, 255)
  1029.                                 iYourColorRing[2] = GetRandomInt(0, 255)
  1030.                                 iYourColorRing[3] = 255;
  1031.                                    
  1032.                                 TE_SetupBeamRingPoint(vPos, 120.0, 0.1, iSprite, iHalo, 0, 66, 25.0, 1.7, 2.0, iYourColorRing, 20, 0)
  1033.                                 TE_SendToAll();
  1034.  
  1035.                                 SetEntProp(iDefib, Prop_Send, "m_nGlowRange", 500);
  1036.                                 SetEntProp(iDefib, Prop_Send, "m_iGlowType", 3);
  1037.                                 SetEntProp(iDefib, Prop_Send, "m_glowColorOverride", GetColor(iColorDefib));
  1038.                                
  1039.                                 DataPack iPack;
  1040.                                 vKillTimer[iDefib] = CreateDataTimer(25.0, vKill, iPack, TIMER_DATA_HNDL_CLOSE)
  1041.                                 WritePackCell(iPack, EntIndexToEntRef(iTrigger));
  1042.                                 WritePackCell(iPack, EntIndexToEntRef(iDefib));
  1043.                             }
  1044.                         }
  1045.                     }
  1046.                     case 4:
  1047.                     {
  1048.                         if(GetRandomInt(0, 100) <= GetConVarInt(ChanceToDropGnome))
  1049.                         {
  1050.                             float vPos[3]
  1051.                             GetEntPropVector(client, Prop_Data, "m_vecOrigin", vPos)
  1052.                             vPos[2] += 20.0;
  1053.                             int iGnome = CreateEntityByName("prop_dynamic_override")
  1054.                             if(IsValidEntity(iGnome))
  1055.                             {
  1056.                                 DispatchKeyValueVector(iGnome, "origin", vPos );
  1057.                                 DispatchKeyValue(iGnome, "model", iDwarf);
  1058.                                 DispatchSpawn(iGnome);
  1059.                                
  1060.                                 int iTrigger = CreateEntityByName("trigger_multiple");
  1061.                                 DispatchKeyValue(iTrigger, "spawnflags", "1");
  1062.                                 DispatchKeyValue(iTrigger, "wait", "0");
  1063.                                 DispatchSpawn(iTrigger);
  1064.                                 ActivateEntity(iTrigger);
  1065.                                 TeleportEntity(iTrigger, vPos, NULL_VECTOR, NULL_VECTOR);
  1066.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", view_as<float>({-25.0, -25.0, -25.0}));
  1067.                                 SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", view_as<float>({25.0, 25.0, 25.0}));  
  1068.                                 SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2);
  1069.                                 HookSingleEntityOutput(iTrigger, "OnStartTouch", OnStartTouchGnome);
  1070.                                
  1071.                                 iKittyCat[iTrigger] = EntIndexToEntRef(iGnome)
  1072.                                 vRoatation = CreateTimer(0.05, vRotation, EntIndexToEntRef(iGnome), TIMER_REPEAT)
  1073.                                
  1074.                                 int iYourColorRing[4];
  1075.                                 iYourColorRing[0] = GetRandomInt(0, 255)
  1076.                                 iYourColorRing[1] = GetRandomInt(0, 255)
  1077.                                 iYourColorRing[2] = GetRandomInt(0, 255)
  1078.                                 iYourColorRing[3] = 255;
  1079.                                    
  1080.                                 TE_SetupBeamRingPoint(vPos, 120.0, 0.1, iSprite, iHalo, 0, 66, 25.0, 1.7, 2.0, iYourColorRing, 20, 0)
  1081.                                 TE_SendToAll();
  1082.  
  1083.                                 SetEntProp(iGnome, Prop_Send, "m_nGlowRange", 500);
  1084.                                 SetEntProp(iGnome, Prop_Send, "m_iGlowType", 3);
  1085.                                 SetEntProp(iGnome, Prop_Send, "m_glowColorOverride", GetColor(iColorDwarf));
  1086.                                
  1087.                                 DataPack iPack;
  1088.                                 vKillTimer[iGnome] = CreateDataTimer(25.0, vKill, iPack, TIMER_DATA_HNDL_CLOSE)
  1089.                                 WritePackCell(iPack, EntIndexToEntRef(iTrigger));
  1090.                                 WritePackCell(iPack, EntIndexToEntRef(iGnome));
  1091.                             }
  1092.                         }
  1093.                     }
  1094.                 }
  1095.             }
  1096.             int vClass = GetEntProp(client, Prop_Send, "m_zombieClass");
  1097.             if (vClass == 1)
  1098.             {
  1099.                 float rFloat = GetRandomFloat(1.0, 2.5);
  1100.                 int Number = GetRandomInt(200, 625);
  1101.                 int Total = RoundToCeil(Number * rFloat)
  1102.                 Cash[attacker] += Total;
  1103.                 Client_PrintToChat(attacker, true, "%t", "KilledSmoker", Total)
  1104.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}куры", Total)
  1105.                 TeamCash += Number;
  1106.             }
  1107.             else if (vClass == 2)
  1108.             {
  1109.                 float rFloat = GetRandomFloat(1.0, 4.0);
  1110.                 int Number = GetRandomInt(200, 300);
  1111.                 int Total = RoundToCeil(Number * rFloat)
  1112.                 Cash[attacker] += Total;
  1113.                 Client_PrintToChat(attacker, true, "%t", "KilledBoomer", Total)
  1114.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}толстого", Total)
  1115.                 TeamCash += Number;
  1116.             }
  1117.             else if (vClass == 3)
  1118.             {
  1119.                 float rFloat = GetRandomFloat(1.0, 3.0);
  1120.                 int Number = GetRandomInt(350, 475);
  1121.                 int Total = RoundToCeil(Number * rFloat)
  1122.                 Cash[attacker] += Total;
  1123.                 Client_PrintToChat(attacker, true, "%t", "KilledHunter", Total)
  1124.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}кузнечика", Total)
  1125.                 TeamCash += Number;
  1126.             }
  1127.             else if (vClass == 4)
  1128.             {
  1129.                 float rFloat = GetRandomFloat(1.0, 3.5);
  1130.                 int Number = GetRandomInt(150, 175);
  1131.                 int Total = RoundToCeil(Number * rFloat)
  1132.                 Cash[attacker] += Total;
  1133.                 Client_PrintToChat(attacker, true, "%t", "KilledSpitter", Total)
  1134.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}какой-то дичи", Total)
  1135.                 TeamCash += Number;
  1136.             }
  1137.             else if (vClass == 5)
  1138.             {
  1139.                 float rFloat = GetRandomFloat(1.0, 2.5);
  1140.                 int Number = GetRandomInt(200, 350);
  1141.                 int Total = RoundToCeil(Number * rFloat)
  1142.                 Cash[attacker] += Total;
  1143.                 Client_PrintToChat(attacker, true, "%t", "KilledJockey", Total)
  1144.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {BLA}урода", Total)
  1145.                 TeamCash += Number;
  1146.             }
  1147.             else if (vClass == 6)
  1148.             {
  1149.                 float rFloat = GetRandomFloat(1.0, 3.5);
  1150.                 int Number = GetRandomInt(300, 650);
  1151.                 int Total = RoundToCeil(Number * rFloat)
  1152.                 Cash[attacker] += Total;
  1153.                 Client_PrintToChat(attacker, true, "%t", "KilledCharger", Total)
  1154.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}родственника", Total)
  1155.                 TeamCash += Number;
  1156.             }
  1157.             else if (vClass == 8)
  1158.             {
  1159.                 float rFloat = GetRandomFloat(1.0, 2.1);
  1160.                 int Number = GetRandomInt(2100, 2850);
  1161.                 int Total = RoundToCeil(Number * rFloat)
  1162.                 Cash[attacker] += Total;
  1163.                 Client_PrintToChat(attacker, true, "%t", "KilledTank", Total)
  1164.                 //Client_PrintToChat(attacker, true, "{R}Вы {B}получили {O}%i {B}за убийство {OG}тупого качка", Total)
  1165.                 TeamCash += Number;
  1166.             }
  1167.         }
  1168.     }
  1169. }
  1170.  
  1171. public void OnStartTouchDefib(const char[] output, int caller, int activator, float delay)
  1172. {
  1173.     if (bIsSurvivor(activator) && iMinecraft[activator])
  1174.     {
  1175.         if(vKillTimer[EntRefToEntIndex(iKittyCat[caller])] != null)
  1176.         {
  1177.             KillTimer(vKillTimer[EntRefToEntIndex(iKittyCat[caller])])
  1178.             vKillTimer[EntRefToEntIndex(iKittyCat[caller])] = null;
  1179.         }
  1180.         if(vRoatation != null)
  1181.         {
  1182.             KillTimer(vRoatation)
  1183.             vRoatation = null;
  1184.         }
  1185.         AcceptEntityInput(caller, "kill")
  1186.         AcceptEntityInput(EntRefToEntIndex(iKittyCat[caller]), "kill")
  1187.         iCountDebifs[activator]++;
  1188.         EmitSoundToAll(iTake, activator, SNDCHAN_AUTO );
  1189.     }
  1190.     else
  1191.     {
  1192.         Client_PrintToChat(activator, true, "%t", "YouNeedPerkCraft")
  1193.     }
  1194. }
  1195.  
  1196. public void OnStartTouchGnome(const char[] output, int caller, int activator, float delay)
  1197. {
  1198.     if (bIsSurvivor(activator) && iMinecraft[activator])
  1199.     {
  1200.         if(vKillTimer[EntRefToEntIndex(iKittyCat[caller])] != null)
  1201.         {
  1202.             KillTimer(vKillTimer[EntRefToEntIndex(iKittyCat[caller])])
  1203.             vKillTimer[EntRefToEntIndex(iKittyCat[caller])] = null;
  1204.         }
  1205.         if(vRoatation != null)
  1206.         {
  1207.             KillTimer(vRoatation)
  1208.             vRoatation = null;
  1209.         }
  1210.         AcceptEntityInput(caller, "kill")
  1211.         AcceptEntityInput(EntRefToEntIndex(iKittyCat[caller]), "kill")
  1212.         iCountGnomes[activator]++;
  1213.         EmitSoundToAll(iTake, activator, SNDCHAN_AUTO );
  1214.     }
  1215.     else
  1216.     {
  1217.         Client_PrintToChat(activator, true, "%t", "YouNeedPerkCraft")
  1218.     }
  1219. }
  1220.  
  1221. public void OnStartTouch(const char[] output, int caller, int activator, float delay)
  1222. {
  1223.     if (bIsSurvivor(activator) && iMinecraft[activator])
  1224.     {
  1225.         if(vKillTimer[EntRefToEntIndex(iKittyCat[caller])] != null)
  1226.         {
  1227.             KillTimer(vKillTimer[EntRefToEntIndex(iKittyCat[caller])])
  1228.             vKillTimer[EntRefToEntIndex(iKittyCat[caller])] = null;
  1229.         }
  1230.         if(vRoatation != null)
  1231.         {
  1232.             KillTimer(vRoatation)
  1233.             vRoatation = null;
  1234.         }
  1235.         AcceptEntityInput(caller, "kill")
  1236.         AcceptEntityInput(EntRefToEntIndex(iKittyCat[caller]), "kill")
  1237.         iCountMedkits[activator]++;
  1238.         EmitSoundToAll(iTake, activator, SNDCHAN_AUTO );
  1239.     }
  1240.     else
  1241.     {
  1242.         Client_PrintToChat(activator, true, "%t", "YouNeedPerkCraft")
  1243.     }
  1244. }
  1245.  
  1246. public void OnStartTouchPills(const char[] output, int caller, int activator, float delay)
  1247. {
  1248.     if (bIsSurvivor(activator) && iMinecraft[activator])
  1249.     {
  1250.         if(vKillTimer[EntRefToEntIndex(iKittyCat[caller])] != null)
  1251.         {
  1252.             KillTimer(vKillTimer[EntRefToEntIndex(iKittyCat[caller])])
  1253.             vKillTimer[EntRefToEntIndex(iKittyCat[caller])] = null;
  1254.         }
  1255.         if(vRoatation != null)
  1256.         {
  1257.             KillTimer(vRoatation)
  1258.             vRoatation = null;
  1259.         }
  1260.         AcceptEntityInput(caller, "kill")
  1261.         AcceptEntityInput(EntRefToEntIndex(iKittyCat[caller]), "kill")
  1262.         iCountPills[activator]++;
  1263.         EmitSoundToAll(iTake, activator, SNDCHAN_AUTO );
  1264.     }
  1265.     else
  1266.     {
  1267.         Client_PrintToChat(activator, true, "%t", "YouNeedPerkCraft")
  1268.     }
  1269. }
  1270.  
  1271. public void OnStartTouchAdrenaline(const char[] output, int caller, int activator, float delay)
  1272. {
  1273.     if (bIsSurvivor(activator) && iMinecraft[activator])
  1274.     {
  1275.         if(vKillTimer[EntRefToEntIndex(iKittyCat[caller])] != null)
  1276.         {
  1277.             KillTimer(vKillTimer[EntRefToEntIndex(iKittyCat[caller])])
  1278.             vKillTimer[EntRefToEntIndex(iKittyCat[caller])] = null;
  1279.         }
  1280.         if(vRoatation != null)
  1281.         {
  1282.             KillTimer(vRoatation)
  1283.             vRoatation = null;
  1284.         }
  1285.         AcceptEntityInput(caller, "kill")
  1286.         AcceptEntityInput(EntRefToEntIndex(iKittyCat[caller]), "kill")
  1287.         iCountAdrenalins[activator]++;
  1288.         EmitSoundToAll(iTake, activator, SNDCHAN_AUTO );
  1289.     }
  1290.     else
  1291.     {
  1292.         Client_PrintToChat(activator, true, "%t", "YouNeedPerkCraft")
  1293.     }
  1294. }
  1295.  
  1296. public Action vRotation(Handle timer, int iKit)
  1297. {
  1298.     iKit = EntRefToEntIndex(iKit)
  1299.     if(IsValidEntity(iKit))
  1300.     {
  1301.         float flAngles[3]
  1302.         GetEntPropVector(iKit, Prop_Send, "m_angRotation", flAngles);
  1303.  
  1304.         flAngles[1] += 3.0;
  1305.         TeleportEntity(iKit, NULL_VECTOR, flAngles, NULL_VECTOR);
  1306.     }
  1307. }
  1308.  
  1309. public Action vKill(Handle timer, Handle iPack)
  1310. {  
  1311.     ResetPack(iPack)
  1312.     int iTrigger = ReadPackCell(iPack)
  1313.     int iKit = ReadPackCell(iPack)
  1314.    
  1315.     iTrigger = EntRefToEntIndex(iTrigger)
  1316.     iKit = EntRefToEntIndex(iKit)
  1317.    
  1318.     if(vRoatation != null)
  1319.     {
  1320.         KillTimer(vRoatation)
  1321.         vRoatation = null;
  1322.     }
  1323.     if(IsValidEntity(iKit))
  1324.     {
  1325.         float desPos[3];
  1326.         GetEntPropVector(iKit, Prop_Send, "m_vecOrigin", desPos );
  1327.  
  1328.         desPos[2] += 5000.0;
  1329.        
  1330.         TeleportEntity(iKit, desPos, NULL_VECTOR, NULL_VECTOR);
  1331.         RemoveEdict(iTrigger)
  1332.         RemoveEdict(iKit)
  1333.     }
  1334. }
  1335.  
  1336. public Action EventDefib(Event event, const char[] name, bool dontBroadcast)
  1337. {
  1338.     int client = GetClientOfUserId(event.GetInt("subject"));
  1339.    
  1340.     if(bIsSurvivor(client))
  1341.     {
  1342.         if(SpeedUp[client])
  1343.         {
  1344.             SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2)
  1345.             SetEntityGravity(client, 0.8);
  1346.         }
  1347.     }
  1348. }
  1349.  
  1350. public Action EventPlayerShove(Event event, const char[] name, bool dontBroadcast)
  1351. {
  1352.     int client = GetClientOfUserId(event.GetInt("userid")), attacker = GetClientOfUserId(event.GetInt("attacker"));
  1353.     if(bIsSurvivor(attacker))
  1354.     {
  1355.         if(IsValidInfected(client))
  1356.         {
  1357.             int vClass = GetEntProp(client, Prop_Send, "m_zombieClass");
  1358.             if(vClass != 4 && vClass != 2)
  1359.             {
  1360.                 if(ShoveDamage[attacker])
  1361.                 {
  1362.                     ForceDamageEntity(attacker, 200, client)
  1363.                 }
  1364.             }
  1365.         }
  1366.     }
  1367. }
  1368.  
  1369. public Action EventShove(Event event, const char[] name, bool dontBroadcast)
  1370. {
  1371.     int client = event.GetInt("entityid");
  1372.     int attacker = GetClientOfUserId(event.GetInt("attacker"));
  1373.  
  1374.     if(bIsSurvivor(attacker))
  1375.     {
  1376.         if(IsCommonInfected(client))
  1377.         {
  1378.             if(ShoveDamage[attacker])
  1379.             {
  1380.                 ForceDamageEntity(attacker, 40, client)
  1381.             }
  1382.         }
  1383.     }
  1384. }
  1385.  
  1386. public Action Gm(int client,int args)
  1387. {
  1388.     Cash[client] += 100000;
  1389. }
  1390.  
  1391. public Action BuyMenu(int client,int args)
  1392. {
  1393.     if(bIsSurvivor(client))
  1394.     {
  1395.         DisplayMainMenu(client)
  1396.     }
  1397. }
  1398.  
  1399. public int MainBox(Handle DontLook, MenuAction action, int client, int symbol)
  1400. {
  1401.     if (action == MenuAction_End)
  1402.     {
  1403.         CloseHandle(DontLook);
  1404.         return;
  1405.     }
  1406.     if (action == MenuAction_Select)
  1407.     {
  1408.         if(symbol == 0)
  1409.         {
  1410.             DisplayStatisticMenu(client)
  1411.         }
  1412.         else if(symbol == 1)
  1413.         {
  1414.             DisplayPerksPassiveMenu(client)
  1415.         }
  1416.         else if(symbol == 2)
  1417.         {
  1418.             DisplayPerksMenu(client);
  1419.         }
  1420.         else if(symbol == 3)
  1421.         {
  1422.             DisplayTransfer(client);
  1423.         }
  1424.         else if(symbol == 4)
  1425.         {
  1426.             DisplayBankTo(client);
  1427.         }
  1428.         else if(symbol == 5)
  1429.         {
  1430.             DisplayTeamHelp(client)
  1431.         }
  1432.         else if(symbol == 6)
  1433.         {
  1434.             DisplayShop(client)
  1435.         }  
  1436.         else if(symbol == 7)
  1437.         {
  1438.             DisplayCraftMenu(client)
  1439.         }
  1440.         else if(symbol == 8)
  1441.         {
  1442.             DisplayInvectory(client)
  1443.         }
  1444.         else if(symbol == 9)
  1445.         {
  1446.             DisplayBag(client)
  1447.         }
  1448.         else if(symbol == 10)
  1449.         {
  1450.             DisplayEveryOneBag(client)
  1451.         }
  1452.     }
  1453. }
  1454.  
  1455. void DisplayInvectory(int client)
  1456. {  
  1457.     Handle BagDisplay = CreateMenu(MyInvMenu);
  1458.     //char sTitle[56];
  1459.     SetMenuTitle(BagDisplay, "%t", "InvectoryMenuTitle");
  1460.    
  1461.     char sStringEx[128];
  1462.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountMedkits", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit))
  1463.     AddMenuItem(BagDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
  1464.  
  1465.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountPills", iCountPills[client], GetConVarInt(NeedToCraftPills))
  1466.     AddMenuItem(BagDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  1467.  
  1468.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountAdrenalins", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline))
  1469.     AddMenuItem(BagDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  1470.  
  1471.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDefibs", iCountDebifs[client], GetConVarInt(NeedToCraftDefib))
  1472.     AddMenuItem(BagDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  1473.  
  1474.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDwarfs", iCountGnomes[client], GetConVarInt(NeedToCraftGnome))
  1475.     AddMenuItem(BagDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  1476.    
  1477.     SetMenuExitBackButton(BagDisplay, true)
  1478.     SetMenuExitButton(BagDisplay, true)
  1479.     DisplayMenu(BagDisplay, client, MENU_TIME_FOREVER);
  1480. }
  1481.  
  1482. public int MyInvMenu(Handle MinecraftCallback, MenuAction action, int client, int symbol)
  1483. {
  1484.  
  1485.     if (action == MenuAction_End)
  1486.     {
  1487.         CloseHandle(MinecraftCallback);
  1488.         return;
  1489.     }
  1490.     if(action == MenuAction_Cancel)
  1491.     {
  1492.         if(symbol == MenuEnd_ExitBack)
  1493.         {
  1494.             DisplayMainMenu(client)
  1495.         }
  1496.     }
  1497. }
  1498.  
  1499. public int MyBagMenu(Handle BagCallback, MenuAction action, int client, int symbol)
  1500. {
  1501.  
  1502.     if (action == MenuAction_End)
  1503.     {
  1504.         CloseHandle(BagCallback);
  1505.         return;
  1506.     }
  1507.  
  1508.     if(symbol == 0)
  1509.     {
  1510.         if(iCraftedMedkits[client] > 0)
  1511.         {
  1512.             iCraftedMedkits[client]--
  1513.             GiveFunction(client, "first_aid_kit")
  1514.             Client_PrintToChat(client, true, "%t", "YouTakeFromBagMedkit", iCraftedMedkits[client])
  1515.         }
  1516.         else
  1517.         {
  1518.             Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedMedkits")
  1519.         }
  1520.     }
  1521.     if(symbol == 1)
  1522.     {
  1523.         if(iCraftedPills[client] > 0)
  1524.         {
  1525.             iCraftedPills[client]--
  1526.             GiveFunction(client, "pain_pills")
  1527.             Client_PrintToChat(client, true, "%t", "YouTakeFromBagPills", iCraftedPills[client])
  1528.         }
  1529.         else
  1530.         {
  1531.             Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedPills")
  1532.         }
  1533.     }
  1534.     if(symbol == 2)
  1535.     {
  1536.         if(iCraftedAdrenalins[client] > 0)
  1537.         {
  1538.             iCraftedAdrenalins[client]--
  1539.             GiveFunction(client, "adrenaline")
  1540.             Client_PrintToChat(client, true, "%t", "YouTakeFromBagAdrenaline", iCraftedAdrenalins[client])
  1541.         }
  1542.         else
  1543.         {
  1544.             Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedAdrenaline")
  1545.         }
  1546.     }
  1547.     if(symbol == 3)
  1548.     {
  1549.         if(iCraftedDebifs[client] > 0)
  1550.         {
  1551.             iCraftedDebifs[client]--
  1552.             GiveFunction(client, "defibrillator")
  1553.             Client_PrintToChat(client, true, "%t", "YouTakeFromBagDefib", iCraftedDebifs[client])
  1554.         }
  1555.         else
  1556.         {
  1557.             Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDefibs")
  1558.         }
  1559.     }
  1560.     if(symbol == 4)
  1561.     {
  1562.         if(iCraftedGnomes[client] > 0)
  1563.         {
  1564.             iCraftedAdrenalins[client]--
  1565.             GiveFunction(client, "gnome")
  1566.             Client_PrintToChat(client, true, "%t", "YouTakeFromBagDwarf", iCraftedGnomes[client])
  1567.         }
  1568.         else
  1569.         {
  1570.             Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDwarfs")
  1571.         }
  1572.     }
  1573.     if(action == MenuAction_Cancel)
  1574.     {
  1575.         if(symbol == MenuEnd_ExitBack)
  1576.         {
  1577.             DisplayMainMenu(client)
  1578.         }
  1579.     }
  1580. }
  1581.  
  1582. void DisplayEveryOneBag(int client)
  1583. {  
  1584.     Handle MainMenuDisplay = CreateMenu(EveryOneDisplayBag);
  1585.     //char sTitle[56];
  1586.     SetMenuTitle(MainMenuDisplay, "%t", "EveryOneBag");
  1587.    
  1588.     char sStringEx[128];
  1589.     Format(sStringEx, sizeof(sStringEx), "%t", "BagEveryOneTransfer", iEveryOneMedkit)
  1590.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1591.    
  1592.     if(iEveryOneMedkit > 0)
  1593.     {
  1594.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit)
  1595.         AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1596.     }
  1597.     else
  1598.     {
  1599.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit)
  1600.         AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  1601.     }
  1602.    
  1603.     if(iEveryOnePills > 0)
  1604.     {
  1605.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills)
  1606.         AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1607.     }
  1608.     else
  1609.     {
  1610.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills)
  1611.         AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  1612.     }
  1613.    
  1614.     if(iEveryOneAdrenalins > 0)
  1615.     {
  1616.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins)
  1617.         AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1618.     }
  1619.     else
  1620.     {
  1621.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins)
  1622.         AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  1623.     }
  1624.    
  1625.     if(iEveryOneDeffibrilator > 0)
  1626.     {
  1627.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator)
  1628.         AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1629.     }
  1630.     else
  1631.     {
  1632.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator)
  1633.         AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  1634.     }
  1635.    
  1636.     if(iEveryOneGnome > 0)
  1637.     {
  1638.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome)
  1639.         AddMenuItem(MainMenuDisplay, "5", sStringEx);
  1640.     }
  1641.     else
  1642.     {
  1643.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome)
  1644.         AddMenuItem(MainMenuDisplay, "5", sStringEx, ITEMDRAW_DISABLED);
  1645.     }
  1646.     SetMenuExitBackButton(MainMenuDisplay, true)
  1647.     SetMenuExitButton(MainMenuDisplay, true)
  1648.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1649. }
  1650.  
  1651. void DisplayEveryOneTransferint(int client)
  1652. {  
  1653.     Handle MainMenuDisplay = CreateMenu(EvetyOneTransfer);
  1654.     //char sTitle[56];
  1655.     SetMenuTitle(MainMenuDisplay, "%t", "EveryoneBagTransfer");
  1656.     char sStringEx[64]
  1657.    
  1658.     if(iCraftedMedkits[client] > 0)
  1659.     {
  1660.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client])
  1661.         AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1662.     }
  1663.     else
  1664.     {
  1665.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client])
  1666.         AddMenuItem(MainMenuDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
  1667.     }
  1668.  
  1669.     if(iCraftedPills[client] > 0)
  1670.     {
  1671.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client])
  1672.         AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1673.     }
  1674.     else
  1675.     {
  1676.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client])
  1677.         AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  1678.     }
  1679.  
  1680.     if(iCraftedAdrenalins[client] > 0)
  1681.     {
  1682.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client])
  1683.         AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1684.     }
  1685.     else
  1686.     {
  1687.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client])
  1688.         AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  1689.     }
  1690.  
  1691.     if(iCraftedDebifs[client] > 0)
  1692.     {
  1693.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client])
  1694.         AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1695.     }
  1696.     else
  1697.     {
  1698.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client])
  1699.         AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  1700.     }
  1701.  
  1702.     if(iCraftedGnomes[client] > 0)
  1703.     {
  1704.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client])
  1705.         AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1706.     }
  1707.     else
  1708.     {
  1709.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client])
  1710.         AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  1711.     }
  1712.  
  1713.     SetMenuExitBackButton(MainMenuDisplay, true)
  1714.     SetMenuExitButton(MainMenuDisplay, true)
  1715.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1716. }
  1717.  
  1718. public int EvetyOneTransfer(Handle BagCallback, MenuAction action, int client, int symbol)
  1719. {
  1720.  
  1721.     if (action == MenuAction_End)
  1722.     {
  1723.         CloseHandle(BagCallback);
  1724.         return;
  1725.     }
  1726.  
  1727.     if(symbol == 0)
  1728.     {
  1729.         iCraftedMedkits[client]--
  1730.         iEveryOneMedkit++
  1731.         Client_PrintToChatAll(true, "%t", "SomeonePutMedkitToBagEveryone", client)
  1732.     }
  1733.     else if(symbol == 1)
  1734.     {
  1735.         iCraftedPills[client]--
  1736.         iEveryOneMedkit++
  1737.         Client_PrintToChatAll(true, "%t", "SomeonePutPillsToBagEveryone", client)
  1738.     }
  1739.     else if(symbol == 2)
  1740.     {
  1741.         iCraftedAdrenalins[client]--
  1742.         iEveryOneMedkit++
  1743.         Client_PrintToChatAll(true, "%t", "SomeonePutAdrenalineToBagEveryone", client)
  1744.     }
  1745.     else if(symbol == 3)
  1746.     {
  1747.         iCraftedDebifs[client]--
  1748.         iEveryOneMedkit++
  1749.         Client_PrintToChatAll(true, "%t", "SomeonePutDefibToBagEveryone", client)
  1750.     }
  1751.     else if(symbol == 4)
  1752.     {
  1753.         iCraftedGnomes[client]--
  1754.         iEveryOneMedkit++
  1755.         Client_PrintToChatAll(true, "%t", "SomeonePutGnomeToBagEveryone", client)
  1756.     }
  1757.     if(action == MenuAction_Cancel)
  1758.     {
  1759.         if(symbol == MenuEnd_ExitBack)
  1760.         {
  1761.             DisplayEveryOneBag(client)
  1762.         }
  1763.     }
  1764. }
  1765.  
  1766. public int EveryOneDisplayBag(Handle BagCallback, MenuAction action, int client, int symbol)
  1767. {
  1768.  
  1769.     if (action == MenuAction_End)
  1770.     {
  1771.         CloseHandle(BagCallback);
  1772.         return;
  1773.     }
  1774.  
  1775.     if(symbol == 0)
  1776.     {
  1777.         DisplayEveryOneTransferint(client)
  1778.     }
  1779.     else if(symbol == 1)
  1780.     {
  1781.         if(iEveryOneMedkit > 0)
  1782.         {
  1783.             iEveryOneMedkit--
  1784.             GiveFunction(client, "first_aid_kit")
  1785.             Client_PrintToChatAll(true, "%t", "EveryOneTakenMedkit", client)
  1786.         }
  1787.     }
  1788.     else if(symbol == 2)
  1789.     {
  1790.         if(iEveryOnePills > 0)
  1791.         {
  1792.             iEveryOnePills--
  1793.             GiveFunction(client, "pills")
  1794.             Client_PrintToChatAll(true, "%t", "EveryOneTakenPills", client)
  1795.         }
  1796.         else
  1797.         {
  1798.             Client_PrintToChat(client, true, "%t", "EvetyOneBagNotPills")
  1799.         }
  1800.     }
  1801.     else if(symbol == 3)
  1802.     {
  1803.         if(iEveryOneAdrenalins > 0)
  1804.         {
  1805.             iEveryOneAdrenalins--
  1806.             GiveFunction(client, "adrenaline")
  1807.             Client_PrintToChatAll(true, "%t", "EveryOneTakenAdrenaline", client)
  1808.         }
  1809.         else
  1810.         {
  1811.             Client_PrintToChat(client, true, "%t", "EvetyOneBagNotAdrenalins")
  1812.         }
  1813.     }
  1814.     else if(symbol == 4)
  1815.     {
  1816.         if(iEveryOneDeffibrilator > 0)
  1817.         {
  1818.             iEveryOneDeffibrilator--
  1819.             GiveFunction(client, "defibrillator")
  1820.             Client_PrintToChatAll(true, "%t", "EveryOneTakenDefibs", client)
  1821.         }
  1822.         else
  1823.         {
  1824.             Client_PrintToChat(client, true, "%t", "EvetyOneBagNotDefibs")
  1825.         }
  1826.     }
  1827.     else if(symbol == 5)
  1828.     {
  1829.         if(iEveryOneGnome > 0)
  1830.         {
  1831.             iEveryOneGnome--
  1832.             GiveFunction(client, "gnome")
  1833.             Client_PrintToChatAll(true, "%t", "EveryOneTakenGnome", client)
  1834.         }
  1835.         else
  1836.         {
  1837.             Client_PrintToChat(client, true, "%t", "EvetyOneBagNotGnome")
  1838.         }
  1839.     }
  1840.     if(action == MenuAction_Cancel)
  1841.     {
  1842.         if(symbol == MenuEnd_ExitBack)
  1843.         {
  1844.             DisplayMainMenu(client)
  1845.         }
  1846.     }
  1847. }
  1848.  
  1849. void DisplayBag(int client)
  1850. {  
  1851.     Handle MainMenuDisplay = CreateMenu(MyBagMenu);
  1852.     //char sTitle[56];
  1853.     SetMenuTitle(MainMenuDisplay, "%t", "MyBagTitle");
  1854.    
  1855.     char sStringEx[128];
  1856.     Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client])
  1857.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1858.  
  1859.     Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client])
  1860.     AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1861.  
  1862.     Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client])
  1863.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1864.  
  1865.     Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client])
  1866.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1867.  
  1868.     Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client])
  1869.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1870.  
  1871.     SetMenuExitBackButton(MainMenuDisplay, true)
  1872.     SetMenuExitButton(MainMenuDisplay, true)
  1873.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1874. }
  1875.  
  1876. void DisplayCraftMenu(int client)
  1877. {  
  1878.     Handle MainMenuDisplay = CreateMenu(Minecraft);
  1879.     //char sTitle[56];
  1880.     SetMenuTitle(MainMenuDisplay, "%t", "CraftMenuTitle");
  1881.    
  1882.     char sStringEx[128];
  1883.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftMedkit", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit))
  1884.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1885.  
  1886.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftPills", iCountPills[client], GetConVarInt(NeedToCraftPills))
  1887.     AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1888.  
  1889.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftAdrenaline", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline))
  1890.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1891.  
  1892.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftDefib", iCountDebifs[client], GetConVarInt(NeedToCraftDefib))
  1893.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1894.  
  1895.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftGnome", iCountGnomes[client], GetConVarInt(NeedToCraftGnome))
  1896.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1897.  
  1898.     SetMenuExitBackButton(MainMenuDisplay, true)
  1899.     SetMenuExitButton(MainMenuDisplay, true)
  1900.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1901. }
  1902.  
  1903. public int Minecraft(Handle MinecraftCallback, MenuAction action, int client, int symbol)
  1904. {
  1905.  
  1906.     if (action == MenuAction_End)
  1907.     {
  1908.         CloseHandle(MinecraftCallback);
  1909.         return;
  1910.     }
  1911.  
  1912.     if(bIsSurvivor(client))
  1913.     {
  1914.         if(symbol == 0)
  1915.         {
  1916.             if(iCountMedkits[client] >= GetConVarInt(NeedToCraftMedkit))
  1917.             {
  1918.                 iCountMedkits[client] -= GetConVarInt(NeedToCraftMedkit);
  1919.                 iCraftedMedkits[client]++;
  1920.                 Client_PrintToChat(client, true, "%t", "YouCraftedMedkit")
  1921.             }
  1922.             else
  1923.             {
  1924.                 Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfMedkits", GetConVarInt(NeedToCraftMedkit) - iCountMedkits[client])
  1925.             }
  1926.         }
  1927.         else if(symbol == 1)
  1928.         {
  1929.             if(iCountPills[client] >= GetConVarInt(NeedToCraftPills))
  1930.             {
  1931.                 iCountPills[client] -= GetConVarInt(NeedToCraftPills);
  1932.                 iCraftedPills[client]++;
  1933.                 Client_PrintToChat(client, true, "%t", "YouCraftedPills")
  1934.             }
  1935.             else
  1936.             {
  1937.                 Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfPills", GetConVarInt(NeedToCraftPills) - iCountPills[client])
  1938.             }
  1939.         }
  1940.         else if(symbol == 2)
  1941.         {
  1942.             if(iCountAdrenalins[client] >= GetConVarInt(NeedToCraftAdrenaline))
  1943.             {
  1944.                 iCountAdrenalins[client] -= GetConVarInt(NeedToCraftAdrenaline);
  1945.                 iCraftedAdrenalins[client]++;
  1946.                 Client_PrintToChat(client, true, "%t", "YouCraftedAdrenaline")
  1947.             }
  1948.             else
  1949.             {
  1950.                 Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfAdrenaline", GetConVarInt(NeedToCraftAdrenaline) - iCountAdrenalins[client])
  1951.             }
  1952.         }
  1953.         else if(symbol == 3)
  1954.         {
  1955.             if(iCountDebifs[client] >= GetConVarInt(NeedToCraftDefib))
  1956.             {
  1957.                 iCountDebifs[client] -= GetConVarInt(NeedToCraftDefib);
  1958.                 iCraftedDebifs[client]++;
  1959.                 Client_PrintToChat(client, true, "%t", "YouCraftedDefib")
  1960.             }
  1961.             else
  1962.             {
  1963.                 Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfDefib", GetConVarInt(NeedToCraftDefib) - iCountDebifs[client])
  1964.             }
  1965.         }
  1966.         else if(symbol == 4)
  1967.         {
  1968.             if(iCountGnomes[client] >= GetConVarInt(NeedToCraftGnome))
  1969.             {
  1970.                 iCountAdrenalins[client] -= GetConVarInt(NeedToCraftGnome);
  1971.                 iCraftedGnomes[client]++;
  1972.                 Client_PrintToChat(client, true, "%t", "YouCraftedGnome")
  1973.             }
  1974.             else
  1975.             {
  1976.                 Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfGnome", GetConVarInt(NeedToCraftAdrenaline) - iCountGnomes[client])
  1977.             }
  1978.         }
  1979.     }
  1980.     if(action == MenuAction_Cancel)
  1981.     {
  1982.         if(symbol == MenuEnd_ExitBack)
  1983.         {
  1984.             DisplayMainMenu(client)
  1985.         }
  1986.     }
  1987. }
  1988.  
  1989. void DisplayMainMenu(int client)
  1990. {  
  1991.     Handle MainMenuDisplay = CreateMenu(MainBox);
  1992.     //char sTitle[56];
  1993.     SetMenuTitle(MainMenuDisplay, "%t", "MainMenuTitle");
  1994.    
  1995.     char sStringEx[128];
  1996.     Format(sStringEx, sizeof(sStringEx), "%t", "Stats")
  1997.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1998.    
  1999.     Format(sStringEx, sizeof(sStringEx), "%t", "Passive Perks")
  2000.     AddMenuItem(MainMenuDisplay, "1", sStringEx);
  2001.    
  2002.     Format(sStringEx, sizeof(sStringEx), "%t", "Perks")
  2003.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  2004.    
  2005.     Format(sStringEx, sizeof(sStringEx), "%t", "TrasferOfMoney")
  2006.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  2007.    
  2008.     Format(sStringEx, sizeof(sStringEx), "%t", "TransferToTeamBank")
  2009.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  2010.    
  2011.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamImprovements")
  2012.     AddMenuItem(MainMenuDisplay, "5", sStringEx);
  2013.    
  2014.     Format(sStringEx, sizeof(sStringEx), "%t", "ShopMainMenu")
  2015.     AddMenuItem(MainMenuDisplay, "6", sStringEx);
  2016.    
  2017.     if(iMinecraft[client])
  2018.     {
  2019.         Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu")
  2020.         AddMenuItem(MainMenuDisplay, "7", sStringEx);
  2021.     }
  2022.     else
  2023.     {
  2024.         Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu")
  2025.         AddMenuItem(MainMenuDisplay, "7", sStringEx, ITEMDRAW_DISABLED);
  2026.     }
  2027.    
  2028.     Format(sStringEx, sizeof(sStringEx), "%t", "InventoryMainMenu")
  2029.     AddMenuItem(MainMenuDisplay, "8", sStringEx);
  2030.    
  2031.     Format(sStringEx, sizeof(sStringEx), "%t", "BagMainMenu")
  2032.     AddMenuItem(MainMenuDisplay, "9", sStringEx);
  2033.    
  2034.     Format(sStringEx, sizeof(sStringEx), "%t", "EveryOneBagMenu")
  2035.     AddMenuItem(MainMenuDisplay, "10", sStringEx);
  2036.    
  2037.     SetMenuExitButton(MainMenuDisplay, true)
  2038.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  2039. }
  2040.  
  2041. void DisplayPerksPassiveMenu(int client)
  2042. {  
  2043.     Handle MainPassivePerks = CreateMenu(MainPerksPassiveMenu);
  2044.     SetMenuTitle(MainPassivePerks, "%t", "TitleMenuPassivePerks");
  2045.     char sStringEx[128];
  2046.     Format(sStringEx, sizeof(sStringEx), "%t", "PerkHelpingHand", GetConVarInt(CostHelpingHand));
  2047.    
  2048.     if(FakeAdrenaline[client])
  2049.     {
  2050.         AddMenuItem(MainPassivePerks, "0", sStringEx, ITEMDRAW_DISABLED);
  2051.     }
  2052.     else
  2053.     {
  2054.         AddMenuItem(MainPassivePerks, "0", sStringEx);
  2055.     }
  2056.  
  2057.     Format(sStringEx, sizeof(sStringEx), "%t", "PerkSpeedUp", GetConVarInt(CostSpeedUp));
  2058.     if(SpeedUp[client])
  2059.     {
  2060.         AddMenuItem(MainPassivePerks, "1", sStringEx, ITEMDRAW_DISABLED);
  2061.     }
  2062.     else
  2063.     {
  2064.         AddMenuItem(MainPassivePerks, "1", sStringEx);
  2065.     }
  2066.    
  2067.     Format(sStringEx, sizeof(sStringEx), "%t", "PerkDoubleJump", GetConVarInt(CostDoubleJump));
  2068.     if(DoubleJump[client])
  2069.     {
  2070.         AddMenuItem(MainPassivePerks, "2", sStringEx, ITEMDRAW_DISABLED);
  2071.     }
  2072.     else
  2073.     {
  2074.         AddMenuItem(MainPassivePerks, "2", sStringEx);
  2075.     }
  2076.    
  2077.     Format(sStringEx, sizeof(sStringEx), "%t", "PerkAntiDamage", GetConVarInt(CostAntiDamage));
  2078.     if(AntiDamage[client])
  2079.     {
  2080.         AddMenuItem(MainPassivePerks, "3", sStringEx, ITEMDRAW_DISABLED);
  2081.     }
  2082.     else
  2083.     {
  2084.         AddMenuItem(MainPassivePerks, "3", sStringEx);
  2085.     }
  2086.    
  2087.     Format(sStringEx, sizeof(sStringEx), "%t", "MeleeDamage", GetConVarInt(CostMeleeDamage));
  2088.     if(MeleeDamageUp[client])
  2089.     {
  2090.         AddMenuItem(MainPassivePerks, "4", sStringEx, ITEMDRAW_DISABLED);
  2091.     }
  2092.     else
  2093.     {
  2094.         AddMenuItem(MainPassivePerks, "4", sStringEx);
  2095.     }
  2096.    
  2097.     Format(sStringEx, sizeof(sStringEx), "%t", "FastRealodPerk", GetConVarInt(CostFastReload));
  2098.     if(FastReload[client])
  2099.     {
  2100.         AddMenuItem(MainPassivePerks, "5", sStringEx, ITEMDRAW_DISABLED);
  2101.     }
  2102.     else
  2103.     {
  2104.         AddMenuItem(MainPassivePerks, "5", sStringEx);
  2105.     }
  2106.     SetMenuExitBackButton(MainPassivePerks, true)
  2107.     SetMenuExitButton(MainPassivePerks, true);
  2108.     DisplayMenu(MainPassivePerks, client, MENU_TIME_FOREVER);
  2109. }
  2110.  
  2111. public int MainPerksPassiveMenu(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
  2112. {
  2113.  
  2114.     if (action == MenuAction_End)
  2115.     {
  2116.         CloseHandle(TeamUpgradeMenu);
  2117.         return;
  2118.     }
  2119.  
  2120.     if(bIsSurvivor(client))
  2121.     {
  2122.         if(symbol == 0)
  2123.         {
  2124.             if(Cash[client] >= GetConVarInt(CostHelpingHand))
  2125.             {
  2126.                 DisplayMainMenu(client)
  2127.                 FakeAdrenaline[client] = true;
  2128.                 Cash[client] -= GetConVarInt(CostHelpingHand)
  2129.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostHelpingHand))
  2130.             }
  2131.                
  2132.         }
  2133.         else if(symbol == 1)
  2134.         {
  2135.             if(Cash[client] >= GetConVarInt(CostSpeedUp))
  2136.             {
  2137.                 DisplayMainMenu(client)
  2138.                 SpeedUp[client] = true;
  2139.                 SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2)
  2140.                 SetEntityGravity(client, 0.8);
  2141.                 Cash[client] -= GetConVarInt(CostSpeedUp)
  2142.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostSpeedUp))
  2143.             }
  2144.         }
  2145.         else if(symbol == 2)
  2146.         {
  2147.             if(Cash[client] >= GetConVarInt(CostDoubleJump))
  2148.             {
  2149.                 DisplayMainMenu(client)
  2150.                 DoubleJump[client] = true;
  2151.                 Cash[client] -= GetConVarInt(CostDoubleJump)
  2152.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostDoubleJump))
  2153.             }
  2154.         }
  2155.         else if(symbol == 3)
  2156.         {
  2157.             if(Cash[client] >= GetConVarInt(CostAntiDamage))
  2158.             {
  2159.                 DisplayMainMenu(client)
  2160.                 AntiDamage[client] = true;
  2161.                 Cash[client] -= GetConVarInt(CostAntiDamage)
  2162.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostAntiDamage))
  2163.             }
  2164.         }
  2165.         else if(symbol == 4)
  2166.         {
  2167.             if(Cash[client] >= GetConVarInt(CostMeleeDamage))
  2168.             {
  2169.                 DisplayMainMenu(client)
  2170.                 MeleeDamageUp[client] = true;
  2171.                 Cash[client] -= GetConVarInt(CostMeleeDamage)
  2172.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostMeleeDamage))
  2173.             }
  2174.         }
  2175.         else if(symbol == 5)
  2176.         {
  2177.             if(Cash[client] >= GetConVarInt(CostFastReload))
  2178.             {
  2179.                 DisplayMainMenu(client)
  2180.                 FastReload[client] = true;
  2181.                 Cash[client] -= GetConVarInt(CostFastReload)
  2182.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostFastReload))
  2183.             }
  2184.         }
  2185.     }
  2186.     if(action == MenuAction_Cancel)
  2187.     {
  2188.         if(symbol == MenuEnd_ExitBack)
  2189.         {
  2190.             DisplayMainMenu(client)
  2191.         }
  2192.     }
  2193. }
  2194.  
  2195. public void OnClientPutInServer(int client)
  2196. {
  2197.     SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  2198. }
  2199.  
  2200. public void OnClientDisconnect(int client)
  2201. {
  2202.     SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  2203. }
  2204.  
  2205. public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)  
  2206. {
  2207.     if(bIsSurvivor(attacker))
  2208.     {
  2209.         if(MeleeDamageUp[attacker])
  2210.         {
  2211.             char sWeaponEx[32];
  2212.             int iCurrentWeapon = GetEntPropEnt(attacker, Prop_Send, "m_hActiveWeapon");
  2213.             if(IsValidEntity(iCurrentWeapon) && iCurrentWeapon > 1)
  2214.             {
  2215.                 GetEntityClassname(iCurrentWeapon, sWeaponEx, sizeof(sWeaponEx));
  2216.                 if(StrContains(sWeaponEx, "melee") > 1)
  2217.                 {
  2218.                     damage *= 1.25;
  2219.                     return Plugin_Changed;
  2220.                 }
  2221.             }
  2222.         }
  2223.     }
  2224.     if(bIsSurvivor(victim))
  2225.     {
  2226.         if(AntiDamage[victim])
  2227.         {
  2228.             damage *= 0.5;
  2229.             return Plugin_Changed;
  2230.         }
  2231.     }
  2232.     return Plugin_Continue;
  2233. }
  2234.  
  2235. void ShowPerksPanelUpgradePipe(int client)
  2236. {
  2237.     Handle PerksUpgrade = CreatePanel();
  2238.     if(vLvLPipes[client] < vMaxLvLPipes)
  2239.     {
  2240.         char sStringEx[128];
  2241.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkNameOfUpgradePipeBomb");
  2242.        
  2243.         char sPanelEx[32];
  2244.         Format(sPanelEx, sizeof(sPanelEx), "%t", "TitleOfUpgradePipeBomb");
  2245.         SetPanelTitle(PerksUpgrade, sPanelEx);
  2246.        
  2247.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  2248.        
  2249.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomblvl", vLvLPipes[client]);
  2250.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  2251.    
  2252.         Format(sStringEx, sizeof(sStringEx), "%t", "CostOfUpgradePipeBomb", GetConVarInt(CostUpgradePipe));
  2253.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  2254.        
  2255.         Format(sStringEx, sizeof(sStringEx), "%t", "CountOfPipesOfPerkPipeBomb", vLvLPipes[client]);
  2256.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  2257.  
  2258.         DrawPanelItem(PerksUpgrade, "Прокачать");
  2259.         DrawPanelItem(PerksUpgrade, "Выйти");
  2260.        
  2261. /*     
  2262.         DrawPanelItem(PerksUpgrade, "Перк: Пайпо Мёт", ITEMDRAW_DISABLED);
  2263.         char sItemEx[32];
  2264.         Format(sItemEx, sizeof(sItemEx), "Уровень перка: %i", vLvLPipes[client]);
  2265.         DrawPanelItem(PerksUpgrade, sItemEx, ITEMDRAW_DISABLED);
  2266.  
  2267.         DrawPanelItem(PerksUpgrade, "Стоимость прокачки: 1000 ", ITEMDRAW_DISABLED);
  2268.         char sItemExPipes[64];
  2269.         Format(sItemExPipes, sizeof(sItemExPipes), "Кол-во вылетаемых пайп: %i", vLvLPipes[client]);
  2270.         DrawPanelItem(PerksUpgrade, sItemExPipes, ITEMDRAW_DISABLED);
  2271.  
  2272.         DrawPanelItem(PerksUpgrade, "Прокачать");
  2273.         DrawPanelItem(PerksUpgrade, "Выйти");
  2274.    
  2275. */
  2276.         SetMenuExitBackButton(PerksUpgrade, true)
  2277.         SendPanelToClient(PerksUpgrade, client, PerksUpgradeCallback, 0);
  2278.         CloseHandle(PerksUpgrade);
  2279.     }
  2280.     else
  2281.     {
  2282.         Client_PrintToChat(client, true, "{R}Вы {L}достигли макс. уровня перка(Пайпо Мёт)");
  2283.     }
  2284. }
  2285.  
  2286. public int PerksUpgradeCallback(Handle panel, MenuAction action, int client, int symbol)
  2287. {
  2288.     if (action == MenuAction_End)
  2289.     {
  2290.         CloseHandle(panel);
  2291.         return;
  2292.     }
  2293.  
  2294.     if(symbol == 5)
  2295.     {
  2296.         if(Cash[client] >= GetConVarInt(CostUpgradePipe))
  2297.         {
  2298.             Cash[client] -= GetConVarInt(CostUpgradePipe);
  2299.             vLvLPipes[client]++;
  2300.             Client_PrintToChat(client, true, "%t", "YouHasBeenUpgradedPipeBomb");
  2301.             Client_PrintToChat(client, true, "%t", "CountOfPipesPerk", vLvLPipes[client]);
  2302.            
  2303.             //Client_PrintToChat(client, true, "{R}Вы {L}прокачали перк(Пайпо Мёт)");
  2304.             //Client_PrintToChat(client, true, "{R}Кол-во пайп:%i", vLvLPipes[client]);
  2305.             DisplayMainMenu(client);
  2306.         }
  2307.     }
  2308.     if(action == MenuAction_Cancel)
  2309.     {
  2310.         if(symbol == MenuEnd_ExitBack)
  2311.         {
  2312.             DisplayPerksMenu(client)
  2313.         }
  2314.     }
  2315. }
  2316.  
  2317. void DisplayPerksMenu(int client)
  2318. {  
  2319.     Handle MainPerks = CreateMenu(MainPerksMenu);  
  2320.     char sStringEx[128];
  2321.     Format(sStringEx, sizeof(sStringEx), "%t", "TitleNameOfMenuPerks");
  2322.     SetMenuTitle(MainPerks, sStringEx);
  2323.    
  2324.     Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBombUpgrade++", GetConVarInt(CostUpgradePipe));
  2325.     if(pPipeDealer[client])
  2326.     {
  2327.         AddMenuItem(MainPerks, "0", sStringEx);
  2328.     }
  2329.     else
  2330.     {
  2331.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomb", GetConVarInt(CostUltraPipe));
  2332.         AddMenuItem(MainPerks, "0", sStringEx);
  2333.     }
  2334.     if(!vPipeIndixite[client])
  2335.     {
  2336.         Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
  2337.         AddMenuItem(MainPerks, "1", sStringEx);
  2338.     }
  2339.     else
  2340.     {
  2341.         Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
  2342.         AddMenuItem(MainPerks, "1", sStringEx, ITEMDRAW_DISABLED);
  2343.     }
  2344.     if(!ShoveDamage[client])
  2345.     {
  2346.         Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
  2347.         AddMenuItem(MainPerks, "2", sStringEx);
  2348.     }
  2349.     else
  2350.     {
  2351.         Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
  2352.         AddMenuItem(MainPerks, "2", sStringEx, ITEMDRAW_DISABLED);
  2353.     }
  2354.     if(!iMinecraft[client])
  2355.     {
  2356.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
  2357.         AddMenuItem(MainPerks, "3", sStringEx);
  2358.     }
  2359.     else
  2360.     {
  2361.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
  2362.         AddMenuItem(MainPerks, "3", sStringEx, ITEMDRAW_DISABLED);
  2363.     }
  2364.     if(!TripleMolotov[client])
  2365.     {
  2366.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov", GetConVarInt(CostEpicMoli));
  2367.         AddMenuItem(MainPerks, "4", sStringEx);
  2368.     }
  2369.     else
  2370.     {
  2371.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov++", GetConVarInt(CostEpicMoliUpgrade));
  2372.         AddMenuItem(MainPerks, "4", sStringEx);
  2373.     }
  2374.     SetMenuExitBackButton(MainPerks, true)
  2375.     SetMenuExitButton(MainPerks, true);
  2376.     DisplayMenu(MainPerks, client, MENU_TIME_FOREVER);
  2377. }
  2378.  
  2379. public int MainPerksMenu(Handle TransferMenu, MenuAction action, int client, int symbol)
  2380. {
  2381.     if (action == MenuAction_End)
  2382.     {
  2383.         CloseHandle(TransferMenu);
  2384.         return;
  2385.     }
  2386.  
  2387.     if(symbol == 0)
  2388.     {
  2389.         if(!pPipeDealer[client])
  2390.         {
  2391.             if(Cash[client] >= GetConVarInt(CostUltraPipe))
  2392.             {
  2393.                 Cash[client] -= GetConVarInt(CostUltraPipe);
  2394.                 pPipeDealer[client] = true;
  2395.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostUltraPipe));
  2396.                 DisplayMainMenu(client);
  2397.             }
  2398.         }
  2399.         else
  2400.         {
  2401.             ShowPerksPanelUpgradePipe(client);
  2402.         }
  2403.     }
  2404.     else if(symbol == 1)
  2405.     {
  2406.         if(Cash[client] >= GetConVarInt(CostPipeIndixite))
  2407.         {
  2408.             Cash[client] -= GetConVarInt(CostPipeIndixite);
  2409.             vPipeIndixite[client] = true;
  2410.             Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostPipeIndixite));
  2411.             DisplayMainMenu(client);
  2412.         }
  2413.     }
  2414.     else if(symbol == 2)
  2415.     {
  2416.         if(Cash[client] >= GetConVarInt(CostShoveDamage))
  2417.         {
  2418.             Cash[client] -= GetConVarInt(CostShoveDamage);
  2419.             ShoveDamage[client] = true;
  2420.             Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostShoveDamage));
  2421.             DisplayMainMenu(client);
  2422.         }
  2423.     }
  2424.     else if(symbol == 3)
  2425.     {
  2426.         if(Cash[client] >= GetConVarInt(CostMinecraft))
  2427.         {
  2428.             Cash[client] -= GetConVarInt(CostMinecraft);
  2429.             iMinecraft[client] = true;
  2430.             Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostMinecraft));
  2431.             DisplayMainMenu(client);
  2432.         }
  2433.     }
  2434.     else if(symbol == 4)
  2435.     {
  2436.         if(!TripleMolotov[client])
  2437.         {
  2438.             if(Cash[client] >= GetConVarInt(CostEpicMoli))
  2439.             {
  2440.                 Cash[client] -= GetConVarInt(CostEpicMoli);
  2441.                 TripleMolotov[client] = true;
  2442.                 Client_PrintToChat(client, true, "{B}-%i", GetConVarInt(CostEpicMoli));
  2443.                 DisplayMainMenu(client);
  2444.             }
  2445.         }
  2446.         else
  2447.         {
  2448.             DisplayUpgradeMolotov(client);
  2449.         }
  2450.     }
  2451.     if(action == MenuAction_Cancel)
  2452.     {
  2453.         if(symbol == MenuEnd_ExitBack)
  2454.         {
  2455.             DisplayMainMenu(client)
  2456.         }
  2457.     }
  2458. }
  2459.  
  2460. void DisplayUpgradeMolotov(int client)
  2461. {  
  2462.     Handle MolikUp = CreateMenu(UpgradeMoloCall);
  2463.  
  2464.     int iLevel = iCountOfMoliks[client];
  2465.     int iLevelM = iCountOfMoliks[client] + 1;
  2466.     //char sTitle[56];
  2467.     SetMenuTitle(MolikUp, "%t", "UpgradeMolotovTitle");
  2468.    
  2469.     char sStringEx[128];
  2470.     Format(sStringEx, sizeof(sStringEx), "%t", "NameOfPerkMolotov");
  2471.     AddMenuItem(MolikUp, "0", sStringEx, ITEMDRAW_DISABLED);
  2472.    
  2473.     Format(sStringEx, sizeof(sStringEx), "%t", "CostUpgradeMolotov", GetConVarInt(CostEpicMoliUpgrade));
  2474.     AddMenuItem(MolikUp, "1", sStringEx, ITEMDRAW_DISABLED);
  2475.    
  2476.     Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovs", iLevel, iMaxLevelMolo);
  2477.     AddMenuItem(MolikUp, "2", sStringEx, ITEMDRAW_DISABLED);
  2478.  
  2479.     Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovsOnNextLevel", iLevelM);
  2480.     AddMenuItem(MolikUp, "3", sStringEx, ITEMDRAW_DISABLED);
  2481.  
  2482.     Format(sStringEx, sizeof(sStringEx), "%t", "LevelOfPerk", iLevel);
  2483.     AddMenuItem(MolikUp, "4", sStringEx, ITEMDRAW_DISABLED);
  2484.  
  2485.     Format(sStringEx, sizeof(sStringEx), "%t", "UpgradeMolikButton");
  2486.     AddMenuItem(MolikUp, "5", sStringEx);
  2487.  
  2488.     SetMenuExitBackButton(MolikUp, true)
  2489.     SetMenuExitButton(MolikUp, true);
  2490.     DisplayMenu(MolikUp, client, MENU_TIME_FOREVER);
  2491. }
  2492.  
  2493. public int UpgradeMoloCall(Handle Shop, MenuAction action, int client, int symbol)
  2494. {
  2495.     if (action == MenuAction_End)
  2496.     {
  2497.         CloseHandle(Shop);
  2498.         return;
  2499.     }
  2500.    
  2501.     if(symbol == 5)
  2502.     {
  2503.         if(iCountOfMoliks[client] < iMaxLevelMolo)
  2504.         {
  2505.             if(Cash[client] >= GetConVarInt(CostEpicMoliUpgrade))
  2506.             {
  2507.                 Cash[client] -= GetConVarInt(CostEpicMoliUpgrade);
  2508.                 iCountOfMoliks[client]++;
  2509.                 Client_PrintToChat(client, true, "%t", "YouUpgradedMolotov", iCountOfMoliks[client], iMaxLevelMolo);
  2510.                 Client_PrintToChat(client, true, "%t", "CountOfMolotovUpgraded", iCountOfMoliks[client]);
  2511.                 DisplayMainMenu(client);
  2512.             }
  2513.         }
  2514.         else
  2515.         {
  2516.             Client_PrintToChat(client, true, "%t", "MaxLevelOfMolotov");
  2517.             DisplayMainMenu(client);
  2518.         }
  2519.     }
  2520.     if(action == MenuAction_Cancel)
  2521.     {
  2522.         if(symbol == MenuEnd_ExitBack)
  2523.         {
  2524.             DisplayMainMenu(client)
  2525.         }
  2526.     }
  2527. }
  2528.  
  2529. void DisplayStatisticMenu(int client)
  2530. {  
  2531.     Handle MainStats = CreateMenu(MainStatsMenu);
  2532.     char sItemEx[56];
  2533.     Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuStatistic");
  2534.     SetMenuTitle(MainStats, sItemEx);
  2535.  
  2536.     Format(sItemEx, sizeof(sItemEx), "%t", "YourMoney", Cash[client]);
  2537.     AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
  2538.  
  2539.     Format(sItemEx, sizeof(sItemEx), "%t", "TeamCash", TeamCash);
  2540.     AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
  2541.    
  2542.     SetMenuExitBackButton(MainStats, true)
  2543.     SetMenuExitButton(MainStats, true);
  2544.     DisplayMenu(MainStats, client, MENU_TIME_FOREVER);
  2545. }
  2546.  
  2547. public int MainStatsMenu(Handle menu, MenuAction action, int client, int symbol)
  2548. {
  2549.     if(action == MenuAction_Cancel)
  2550.     {
  2551.         if(symbol == MenuEnd_ExitBack)
  2552.         {
  2553.             DisplayMainMenu(client)
  2554.         }
  2555.     }
  2556. }
  2557.  
  2558. void DisplayBankTo(int client)
  2559. {  
  2560.     Handle BankTo = CreateMenu(MenuBankTransfer);  
  2561.     SetMenuTitle(BankTo, "Ваш вклад:");
  2562.     AddMenuItem(BankTo, "0", "10%");
  2563.     AddMenuItem(BankTo, "1", "20%");
  2564.     AddMenuItem(BankTo, "2", "30%");
  2565.     AddMenuItem(BankTo, "3", "40%");
  2566.     AddMenuItem(BankTo, "4", "50%");
  2567.     AddMenuItem(BankTo, "5", "60%");
  2568.     AddMenuItem(BankTo, "6", "70%");
  2569.     AddMenuItem(BankTo, "7", "80%");
  2570.     AddMenuItem(BankTo, "8", "90%");
  2571.     AddMenuItem(BankTo, "9", "100%");
  2572.  
  2573.     SetMenuExitBackButton(BankTo, true)
  2574.     SetMenuExitButton(BankTo, true);
  2575.     DisplayMenu(BankTo, client, MENU_TIME_FOREVER);
  2576. }
  2577.  
  2578. void DisplayShop(int client)
  2579. {  
  2580.     Handle Shop = CreateMenu(MenuShop);
  2581.     char sItemEx[96];
  2582.     Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuShop");
  2583.     SetMenuTitle(Shop, sItemEx);
  2584.    
  2585.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmo", GetConVarInt(CostExpAmmo));
  2586.     AddMenuItem(Shop, "0", sItemEx);
  2587.    
  2588.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmo", GetConVarInt(CostIncAmmo));
  2589.     AddMenuItem(Shop, "1", sItemEx);
  2590.    
  2591.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopLaserSight", GetConVarInt(CostLaserSight));
  2592.     AddMenuItem(Shop, "2", sItemEx);
  2593.    
  2594.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmoPack", GetConVarInt(CostExpAmmoPack));
  2595.     AddMenuItem(Shop, "3", sItemEx);
  2596.    
  2597.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmoPack", GetConVarInt(CostIncAmmoPack));
  2598.     AddMenuItem(Shop, "4", sItemEx);
  2599.     //AddMenuItem(Shop, "3", "40%");
  2600.     //AddMenuItem(Shop, "4", "50%");
  2601.     //AddMenuItem(Shop, "5", "60%");
  2602.     //AddMenuItem(Shop, "6", "70%");
  2603.     //AddMenuItem(Shop, "7", "80%");
  2604.     //AddMenuItem(Shop, "8", "90%");
  2605.     //AddMenuItem(Shop, "9", "100%");
  2606.  
  2607.     SetMenuExitBackButton(Shop, true)
  2608.     SetMenuExitButton(Shop, true);
  2609.     DisplayMenu(Shop, client, MENU_TIME_FOREVER);
  2610. }
  2611.  
  2612. public int MenuShop(Handle Shop, MenuAction action, int client, int symbol)
  2613. {
  2614.     if (action == MenuAction_End)
  2615.     {
  2616.         CloseHandle(Shop);
  2617.         return;
  2618.     }
  2619.    
  2620.     if(symbol == 0)
  2621.     {
  2622.         if(Cash[client] >= GetConVarInt(CostExpAmmo))
  2623.         {
  2624.             Cash[client] -= GetConVarInt(CostExpAmmo);
  2625.             GiveUpgrade(client, 1);
  2626.             Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
  2627.         }
  2628.     }
  2629.     else if(symbol == 1)
  2630.     {
  2631.         if(Cash[client] >= GetConVarInt(CostIncAmmo))
  2632.         {
  2633.             Cash[client] -= GetConVarInt(CostIncAmmo);
  2634.             GiveUpgrade(client, 2);
  2635.             Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
  2636.         }
  2637.     }
  2638.     else if(symbol == 2)
  2639.     {
  2640.         if(Cash[client] >= GetConVarInt(CostLaserSight))
  2641.         {
  2642.             Cash[client] -= GetConVarInt(CostLaserSight);
  2643.             GiveUpgrade(client, 3);
  2644.             Client_PrintToChat(client, true, "%t", "BoughtLaserSight");
  2645.         }
  2646.     }
  2647.     else if(symbol == 3)
  2648.     {
  2649.         if(Cash[client] >= GetConVarInt(CostExpAmmoPack))
  2650.         {
  2651.             Cash[client] -= GetConVarInt(CostExpAmmoPack);
  2652.             GiveFunction(client, "upgradepack_explosive");
  2653.             Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
  2654.         }
  2655.     }
  2656.     else if(symbol == 4)
  2657.     {
  2658.         if(Cash[client] >= GetConVarInt(CostIncAmmoPack))
  2659.         {
  2660.             Cash[client] -= GetConVarInt(CostIncAmmoPack);
  2661.             GiveFunction(client, "upgradepack_incendiary");
  2662.             Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
  2663.         }
  2664.     }
  2665.     if(action == MenuAction_Cancel)
  2666.     {
  2667.         if(symbol == MenuEnd_ExitBack)
  2668.         {
  2669.             DisplayMainMenu(client)
  2670.         }
  2671.     }
  2672. }
  2673.  
  2674. public int MenuBankTransfer(Handle TransferMenu, MenuAction action, int client, int symbol)
  2675. {
  2676.     if (action == MenuAction_End)
  2677.     {
  2678.         CloseHandle(TransferMenu);
  2679.         return;
  2680.     }
  2681.  
  2682.     int TrasferCash = Cash[client];
  2683.     int NumCash = 0;
  2684.     int Procents = 0;
  2685.     if(bIsSurvivor(client))
  2686.     {
  2687.         if(symbol == 0)
  2688.         {
  2689.             NumCash = RoundToCeil(TrasferCash * 0.1);
  2690.             Cash[client] -= NumCash;
  2691.             TeamCash += NumCash;
  2692.             Procents = 10;
  2693.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2694.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2695.         }
  2696.         else if(symbol == 1)
  2697.         {
  2698.             NumCash = RoundToCeil(TrasferCash * 0.2);
  2699.             Cash[client] -= NumCash;
  2700.             TeamCash += NumCash;
  2701.             Procents = 20;
  2702.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2703.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2704.         }
  2705.         else if(symbol == 2)
  2706.         {
  2707.             NumCash = RoundToCeil(TrasferCash * 0.3);
  2708.             Cash[client] -= NumCash;
  2709.             TeamCash += NumCash;
  2710.             Procents = 30;
  2711.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2712.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2713.         }
  2714.         else if(symbol == 3)
  2715.         {
  2716.             NumCash = RoundToCeil(TrasferCash * 0.4);
  2717.             Cash[client] -= NumCash;
  2718.             TeamCash += NumCash;
  2719.             Procents = 40;
  2720.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2721.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2722.         }
  2723.         else if(symbol == 4)
  2724.         {
  2725.             NumCash = RoundToCeil(TrasferCash * 0.5);
  2726.             Cash[client] -= NumCash;
  2727.             TeamCash += NumCash;
  2728.             Procents = 50;
  2729.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2730.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2731.         }
  2732.         else if(symbol == 5)
  2733.         {
  2734.             NumCash = RoundToCeil(TrasferCash * 0.6);
  2735.             Cash[client] -= NumCash;
  2736.             TeamCash += NumCash;
  2737.             Procents = 60;
  2738.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2739.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2740.         }
  2741.         else if(symbol == 6)
  2742.         {
  2743.             NumCash = RoundToCeil(TrasferCash * 0.7);
  2744.             Cash[client] -= NumCash;
  2745.             TeamCash += NumCash;
  2746.             Procents = 70;
  2747.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2748.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2749.         }
  2750.         else if(symbol == 7)
  2751.         {
  2752.             NumCash = RoundToCeil(TrasferCash * 0.8);
  2753.             Cash[client] -= NumCash;
  2754.             TeamCash += NumCash;
  2755.             Procents = 80;
  2756.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2757.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2758.         }
  2759.         else if(symbol == 8)
  2760.         {
  2761.             NumCash = RoundToCeil(TrasferCash * 0.9);
  2762.             Cash[client] -= NumCash;
  2763.             TeamCash += NumCash;
  2764.             Procents = 90;
  2765.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2766.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2767.         }
  2768.         else if(symbol == 9)
  2769.         {
  2770.             NumCash = RoundToCeil(TrasferCash * 1.0);
  2771.             Cash[client] -= NumCash;
  2772.             TeamCash += NumCash;
  2773.             Procents = 100;
  2774.             Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  2775.             //Client_PrintToChat(client, true, "{B}Вы положили в банк {BLA}%i", NumCash);
  2776.         }
  2777.     }
  2778.     if(action == MenuAction_Cancel)
  2779.     {
  2780.         if(symbol == MenuEnd_ExitBack)
  2781.         {
  2782.             DisplayMainMenu(client)
  2783.         }
  2784.     }
  2785. }
  2786.  
  2787. void DisplayTeamHelp(int client)
  2788. {  
  2789.     Handle TeamUp = CreateMenu(MenuTeamUpgrade);   
  2790.     char sStringEx[64];
  2791.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradesTitle");
  2792.    
  2793.     SetMenuTitle(TeamUp, sStringEx);
  2794.     if(vHealUpTeam == null)
  2795.     {
  2796.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
  2797.         AddMenuItem(TeamUp, "0", sStringEx);
  2798.     }
  2799.     else
  2800.     {
  2801.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
  2802.         AddMenuItem(TeamUp, "0", sStringEx, ITEMDRAW_DISABLED);
  2803.     }
  2804.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeKillAllCommons");
  2805.     AddMenuItem(TeamUp, "1", sStringEx);
  2806.     if(vPoisonTeam != null)
  2807.     {
  2808.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
  2809.         AddMenuItem(TeamUp, "2", sStringEx, ITEMDRAW_DISABLED);
  2810.     }
  2811.     else
  2812.     {
  2813.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
  2814.         AddMenuItem(TeamUp, "2", sStringEx);
  2815.     }
  2816.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeIgniteAssForAllSpecials");
  2817.     AddMenuItem(TeamUp, "3", sStringEx);
  2818.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeHealAllSurvivorFor50Hp");
  2819.     AddMenuItem(TeamUp, "4", sStringEx);
  2820.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeBuyAmmoForAllSurvivors");
  2821.     AddMenuItem(TeamUp, "5", sStringEx);
  2822.     SetMenuExitBackButton(TeamUp, true)
  2823.     SetMenuExitButton(TeamUp, true);
  2824.     DisplayMenu(TeamUp, client, MENU_TIME_FOREVER);
  2825. }
  2826.  
  2827. public int MenuTeamUpgrade(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
  2828. {
  2829.     if (action == MenuAction_End)
  2830.     {
  2831.         CloseHandle(TeamUpgradeMenu);
  2832.         return;
  2833.     }
  2834.  
  2835.     if(bIsSurvivor(client))
  2836.     {
  2837.         if(symbol == 0)
  2838.         {
  2839.             if(TeamCash >= 50000)
  2840.             {
  2841.                 vHealUpTeam = CreateTimer(2.0, vTeamHealUp, _, TIMER_REPEAT);
  2842.                 //TeamHeal = true;
  2843.                 TeamCash -= 50000;
  2844.                 for(int i = 1; i <= MaxClients; ++i)
  2845.                 {
  2846.                     if(client != i)
  2847.                     {
  2848.                         if(IsInGame(i))
  2849.                         {
  2850.                             Client_PrintToChat(i, true, "%t", "ChatWhoBoughtRegeneration", client);
  2851.                             //Client_PrintToChat(i, true, "{B}%N {R}купил регенерацию хп для выживших.", client);
  2852.                         }
  2853.                     }
  2854.                     else
  2855.                     {
  2856.                         if(IsInGame(i))
  2857.                         {
  2858.                             Client_PrintToChat(i, true, "%t", "YouBuyRegeneration");
  2859.                             //Client_PrintToChat(i, true, "{B}Вы {R}купили регенерацию хп.");
  2860.                         }
  2861.                     }
  2862.                 }
  2863.             }
  2864.         }
  2865.         else if(symbol == 1)
  2866.         {
  2867.             if(TeamCash >= 30000)
  2868.             {
  2869.                 TeamCash -= 30000;
  2870.                 for(int i = 33; i <= 2048; ++i)
  2871.                 {
  2872.                     if(IsCommonInfected(i))
  2873.                     {
  2874.                         ForceDamageEntity(client, 1000, i);
  2875.                     }
  2876.                 }
  2877.                 for(int i = 1; i <= MaxClients; ++i)
  2878.                 {
  2879.                     if(client != i)
  2880.                     {
  2881.                         if(IsInGame(i))
  2882.                         {
  2883.                             Client_PrintToChat(i, true, "%t", "WhoKilledAllCommonForTeamCash", client);
  2884.                             //Client_PrintToChat(i, true, "{B}%N {R}убил всех мобов за командные очки.", client);
  2885.                         }
  2886.                     }
  2887.                     else
  2888.                     {
  2889.                         if(IsInGame(i))
  2890.                         {
  2891.                             Client_PrintToChat(i, true, "%t", "YouKilledAllCommonsForTeamCash");
  2892.                         }
  2893.                     }
  2894.                 }
  2895.             }
  2896.         }
  2897.         else if(symbol == 2)
  2898.         {
  2899.             if(TeamCash >= 30000)
  2900.             {
  2901.                 vPoisonTeam = CreateTimer(2.0, vTeamPoison, client, TIMER_REPEAT);
  2902.                 CreateTimer(30.0, vTeamPoisonKill);
  2903.                 TeamCash -= 30000;
  2904.                 for(int i = 1; i <= MaxClients; ++i)
  2905.                 {
  2906.                     if(client != i)
  2907.                     {
  2908.                         if(IsInGame(i))
  2909.                         {
  2910.                             Client_PrintToChat(i, true, "%t.", "WhoPoisonedInf", client);
  2911.                             //Client_PrintToChat(i, true, "{B}%N {R}отравил заражённых за командные очки.", client);
  2912.                         }
  2913.                     }
  2914.                     else
  2915.                     {
  2916.                         if(IsInGame(i))
  2917.                         {
  2918.                             Client_PrintToChat(i, true, "%t.", "YouPoisonedInf", client);
  2919.                             Client_PrintToChat(i, true, "{B}Вы {R}отравили заражённых.");
  2920.                         }
  2921.                     }
  2922.                 }
  2923.             }
  2924.         }
  2925.         else if(symbol == 3)
  2926.         {
  2927.             if(TeamCash >= 10000)
  2928.             {
  2929.                 TeamCash -= 10000;
  2930.                 for(int i = 1; i <= MaxClients; ++i)
  2931.                 {
  2932.                     if(client != i)
  2933.                     {
  2934.                         if(IsInGame(i))
  2935.                         {
  2936.                             Client_PrintToChat(i, true, "%t.", "WhoIgnitedTheHearts", client);
  2937.                             //Client_PrintToChat(i, true, "{B}%N {R}поджог пукан заражённых.", client);
  2938.                         }
  2939.                     }
  2940.                     else
  2941.                     {
  2942.                         if(IsInGame(i))
  2943.                         {
  2944.                             Client_PrintToChat(i, true, "%t.", "YouIgnitedTheHearts", client);
  2945.                             Client_PrintToChat(i, true, "{B}Вы {R}воспламенили очаг.");
  2946.                         }
  2947.                     }
  2948.                     if(IsValidInfected(i))
  2949.                     {
  2950.                         float vPos[3];
  2951.                         GetClientAbsOrigin(i, vPos);
  2952.                         LittleFlower(vPos, 0);
  2953.                         LittleFlower(vPos, 1);
  2954.                     }
  2955.                 }
  2956.             }
  2957.         }
  2958.         else if(symbol == 4)
  2959.         {
  2960.             if(TeamCash >= 15000)
  2961.             {
  2962.                 TeamCash -= 15000;
  2963.                 for(int i = 1; i <= MaxClients; ++i)
  2964.                 {
  2965.                     if(client != i)
  2966.                     {
  2967.                         if(IsInGame(i))
  2968.                         {
  2969.                             Client_PrintToChat(i, true, "%t.", "WhoHealedSurvivors", client);
  2970.                             //Client_PrintToChat(i, true, "{B}%N {R}вылечил всех на 50 хп за командные очки.", client);
  2971.                         }
  2972.                     }
  2973.                     else
  2974.                     {
  2975.                         if(IsInGame(i))
  2976.                         {
  2977.                             Client_PrintToChat(i, true, "%t.", "YouHealedSurvivors");
  2978.                             //Client_PrintToChat(i, true, "{B}Вы {R}полечили всех выживших.");
  2979.                         }
  2980.                     }
  2981.                     if(bIsSurvivor(i) && !IsPlayerIncaped(i))
  2982.                     {
  2983.                         int vHeal = GetClientHealth(i);
  2984.                         float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
  2985.                        
  2986.                         if(vHeal + 50 + RoundToCeil(vHealthBuffer) > 100 || vHeal > 100 || vHealthBuffer > 100 || vHeal + vHealthBuffer > 100)
  2987.                         {
  2988.                             SetEntityHealth(i, 100);
  2989.                             SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
  2990.                         }
  2991.                         else if(RoundToCeil(vHeal + vHealthBuffer) < 100)
  2992.                         {
  2993.                             float vForward = vHeal - vHealthBuffer;
  2994.                             if(vForward < 0)
  2995.                             {
  2996.                                 SetEntityHealth(i, vHeal + 50);
  2997.                                 SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
  2998.                             }
  2999.                             else
  3000.                             {
  3001.                                 float vTransitPoint = 50 - vHealthBuffer;
  3002.                                 SetEntityHealth(i, RoundToCeil(vHeal + vTransitPoint));
  3003.                                 SetEntPropFloat(client, Prop_Send, "m_healthBuffer", vHealthBuffer - vTransitPoint);
  3004.                             }
  3005.                         }
  3006.                     }
  3007.                 }
  3008.             }
  3009.         }
  3010.         else if(symbol == 5)
  3011.         {
  3012.             if(TeamCash >= 3000)
  3013.             {
  3014.                 TeamCash -= 3000;
  3015.                 for(int i = 1; i <= MaxClients; ++i)
  3016.                 {
  3017.                     if(client != i)
  3018.                     {
  3019.                         if(IsInGame(i))
  3020.                         {
  3021.                             Client_PrintToChat(i, true, "%t.", "WhoBuyAmmo", client);
  3022.                             //Client_PrintToChat(i, true, "{B}%N {R}купил всем патроны за командные очки.", client);
  3023.                         }
  3024.                     }
  3025.                     else
  3026.                     {
  3027.                         if(IsInGame(i))
  3028.                         {
  3029.                             Client_PrintToChat(i, true, "%t.", "YouBuyAmmo");
  3030.                             //Client_PrintToChat(i, true, "{B}Вы {R}купили патроны всем выжившим.");
  3031.                         }
  3032.                     }
  3033.                     if(bIsSurvivor(i))
  3034.                     {
  3035.                         GiveFunction(i, "ammo");
  3036.                     }
  3037.                 }
  3038.             }
  3039.         }
  3040.     }
  3041.     if(action == MenuAction_Cancel)
  3042.     {
  3043.         if(symbol == MenuEnd_ExitBack)
  3044.         {
  3045.             DisplayMainMenu(client)
  3046.         }
  3047.     }
  3048. }
  3049.  
  3050. public Action vTeamHealUp(Handle timer)
  3051. {
  3052.     for(int i = 1; i <= MaxClients; ++i)
  3053.     {
  3054.         if(bIsSurvivor(i) && !IsPlayerIncaped(i))
  3055.         {
  3056.             int iHeal = GetClientHealth(i);
  3057.             float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
  3058.  
  3059.             if(RoundToCeil(vHealthBuffer) > 0 && iHeal < 100)
  3060.             {
  3061.                 SetEntityHealth(i, iHeal + 1);
  3062.                 SetEntPropFloat(i, Prop_Send, "m_healthBuffer", vHealthBuffer - 1);
  3063.             }
  3064.             else if(iHeal < 100 && vHealthBuffer < 1)
  3065.             {
  3066.                 SetEntityHealth(i, iHeal + 1);
  3067.             }
  3068.         }
  3069.     }
  3070. }
  3071.  
  3072. public Action vTeamPoison(Handle timer, int client)
  3073. {
  3074.     for(int i = 1; i <= MaxClients; ++i)
  3075.     {
  3076.         if(IsValidInfected(i))
  3077.         {
  3078.             ForceDamageEntity(client, 25, i);
  3079.         }
  3080.     }
  3081. }
  3082.  
  3083. public Action vTeamPoisonKill(Handle timer)
  3084. {
  3085.     KillTimer(vPoisonTeam);
  3086.     vPoisonTeam = null;
  3087. }
  3088.  
  3089. void DisplayTransfer(int client)
  3090. {
  3091.     Handle MainTransfer = CreateMenu(MenuTrasnfer);
  3092.     char sStringEx[32];
  3093.     Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransferPlayersList");
  3094.     SetMenuTitle(MainTransfer, sStringEx);
  3095.    
  3096.     char userid[15];
  3097.     char name[32];
  3098.    
  3099.     for (int i = 1; i <= MaxClients; i++)
  3100.     {
  3101.         if (bIsSurvivor(i) && !IsFakeClient(i) && client != i)
  3102.         {
  3103.             IntToString(GetClientUserId(i), userid, 15);
  3104.             GetClientName(i, name, 32);
  3105.             AddMenuItem(MainTransfer, userid, name);
  3106.         }
  3107.     }
  3108.     SetMenuExitBackButton(MainTransfer, true)
  3109.     SetMenuExitButton(MainTransfer, true);
  3110.     DisplayMenu(MainTransfer, client, MENU_TIME_FOREVER);
  3111. }
  3112.  
  3113. void DisplayTransferSecondPart(int client)
  3114. {  
  3115.     Handle MainTransferSecond = CreateMenu(MenuTrasnferSecond);
  3116.     char sStringEx[32];
  3117.     Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransfer");
  3118.     SetMenuTitle(MainTransferSecond, sStringEx);
  3119.    
  3120.     AddMenuItem(MainTransferSecond, "0", "10%");
  3121.     AddMenuItem(MainTransferSecond, "1", "20%");
  3122.     AddMenuItem(MainTransferSecond, "2", "30%");
  3123.     AddMenuItem(MainTransferSecond, "3", "40%");
  3124.     AddMenuItem(MainTransferSecond, "4", "50%");
  3125.     AddMenuItem(MainTransferSecond, "5", "60%");
  3126.     AddMenuItem(MainTransferSecond, "6", "70%");
  3127.     AddMenuItem(MainTransferSecond, "7", "80%");
  3128.     AddMenuItem(MainTransferSecond, "8", "90%");
  3129.     AddMenuItem(MainTransferSecond, "9", "100%");
  3130.    
  3131.     SetMenuExitBackButton(MainTransferSecond, true)
  3132.     SetMenuExitButton(MainTransferSecond, true);
  3133.     DisplayMenu(MainTransferSecond, client, MENU_TIME_FOREVER);
  3134. }
  3135.  
  3136. public int MenuTrasnferSecond(Handle MenuTrasnferCallback, MenuAction action, int client, int symbol)
  3137. {
  3138.     if(bIsSurvivor(client))
  3139.     {
  3140.         if (action == MenuAction_End)
  3141.         {
  3142.             CloseHandle(MenuTrasnferCallback);
  3143.             return;
  3144.         }
  3145.        
  3146.         int TrasferCash = Cash[client];
  3147.         int Victim = Target[client];
  3148.         int NumCash = 0;
  3149.         int Percents = 0;
  3150.         if(symbol == 0)
  3151.         {
  3152.             NumCash = RoundToCeil(TrasferCash * 0.1);
  3153.             Cash[client] -= NumCash;
  3154.             Cash[Victim] += NumCash;
  3155.             Percents = 10;
  3156.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3157.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3158.         }
  3159.         else if(symbol == 1)
  3160.         {
  3161.             NumCash = RoundToCeil(TrasferCash * 0.2);
  3162.             Cash[client] -= NumCash;
  3163.             Cash[Target[client]] += NumCash;
  3164.             Percents = 20;
  3165.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3166.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3167.         }
  3168.         else if(symbol == 2)
  3169.         {
  3170.             NumCash = RoundToCeil(TrasferCash * 0.3);
  3171.             Cash[client] -= NumCash;
  3172.             Cash[Target[client]] += NumCash;
  3173.             Percents = 30;
  3174.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3175.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3176.         }
  3177.         else if(symbol == 3)
  3178.         {
  3179.             NumCash = RoundToCeil(TrasferCash * 0.4);
  3180.             Cash[client] -= NumCash;
  3181.             Cash[Target[client]] += NumCash;
  3182.             Percents = 40;
  3183.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3184.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3185.         }
  3186.         else if(symbol == 4)
  3187.         {
  3188.             NumCash = RoundToCeil(TrasferCash * 0.5);
  3189.             Cash[client] -= NumCash;
  3190.             Cash[Target[client]] += NumCash;
  3191.             Percents = 50;
  3192.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3193.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3194.         }
  3195.         else if(symbol == 5)
  3196.         {
  3197.             NumCash = RoundToCeil(TrasferCash * 0.6);
  3198.             Cash[client] -= NumCash;
  3199.             Cash[Target[client]] += NumCash;
  3200.             Percents = 60;
  3201.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3202.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3203.         }
  3204.         else if(symbol == 6)
  3205.         {
  3206.             NumCash = RoundToCeil(TrasferCash * 0.7);
  3207.             Cash[client] -= NumCash;
  3208.             Cash[Target[client]] += NumCash;
  3209.             Percents = 70;
  3210.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3211.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3212.         }
  3213.         else if(symbol == 7)
  3214.         {
  3215.             NumCash = RoundToCeil(TrasferCash * 0.8);
  3216.             Cash[client] -= NumCash;
  3217.             Cash[Target[client]] += NumCash;
  3218.             Percents = 80;
  3219.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3220.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3221.         }
  3222.         else if(symbol == 8)
  3223.         {
  3224.             NumCash = RoundToCeil(TrasferCash * 0.9);
  3225.             Cash[client] -= NumCash;
  3226.             Cash[Target[client]] += NumCash;
  3227.             Percents = 90;
  3228.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3229.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3230.         }
  3231.         else if(symbol == 9)
  3232.         {
  3233.             NumCash = RoundToCeil(TrasferCash * 1.0);
  3234.             Cash[client] -= NumCash;
  3235.             Cash[Target[client]] += NumCash;
  3236.             Percents = 100;
  3237.             Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  3238.             Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  3239.         }
  3240.     }
  3241.     if(action == MenuAction_Cancel)
  3242.     {
  3243.         if(symbol == MenuEnd_ExitBack)
  3244.         {
  3245.             DisplayTransfer(client)
  3246.         }
  3247.     }
  3248. }
  3249.  
  3250. /*
  3251. void DisplayMuneBought(int client)
  3252. {
  3253.     Handle MenuBought = CreateMenu(MenuBoughtD);
  3254.     char sExternalString[32];
  3255.     Format(sExternalString, sizeof(sExternalString), "%t", "TitleNameOfMyPurchase");
  3256.     SetMenuTitle(MenuBought, sExternalString);
  3257.     if(ShoveDamage[client])
  3258.     {
  3259.         Format(sExternalString, sizeof(sExternalString), "%t", "ShoveDamage");
  3260.         AddMenuItem(MenuBought, "1", sExternalString, ITEMDRAW_DISABLED);
  3261.     }
  3262.     if(FakeAdrenaline[client])
  3263.     {
  3264.         Format(sExternalString, sizeof(sExternalString), "%t", "PerkHelpingHand");
  3265.         AddMenuItem(MenuBought, "2", sExternalString, ITEMDRAW_DISABLED);
  3266.     }
  3267.     if(SpeedUp[client])
  3268.     {
  3269.         Format(sExternalString, sizeof(sExternalString), "%t", "PerkSpeedUp");
  3270.         AddMenuItem(MenuBought, "3", sExternalString, ITEMDRAW_DISABLED);
  3271.     }
  3272.     if(pPipeDealer[client])
  3273.     {
  3274.         Format(sExternalString, sizeof(sExternalString), "%t", "PerkPipeBomb");
  3275.         AddMenuItem(MenuBought, "4", sExternalString, ITEMDRAW_DISABLED);
  3276.     }
  3277.     if(vPipeIndixite[client])
  3278.     {
  3279.         Format(sExternalString, sizeof(sExternalString), "%t", "StickyPipeBomb");
  3280.         AddMenuItem(MenuBought, "4", sExternalString, ITEMDRAW_DISABLED);
  3281.     }
  3282.     if(DoubleJump[client])
  3283.     {
  3284.         Format(sExternalString, sizeof(sExternalString), "%t", "PerkDoubleJump");
  3285.         AddMenuItem(MenuBought, "5", sExternalString, ITEMDRAW_DISABLED);
  3286.     }
  3287.     SetMenuExitButton(MenuBought, true);
  3288.     DisplayMenu(MenuBought, client, MENU_TIME_FOREVER);
  3289. }
  3290.  
  3291. public int MenuBoughtD(Handle NotNeeddeed, MenuAction action, int client, int symbol){}
  3292. */
  3293. public int MenuTrasnfer(Handle CallBackTransfer, MenuAction action, int client, int option)
  3294. {
  3295.     if(bIsSurvivor(client))
  3296.     {
  3297.         if (action == MenuAction_End)
  3298.         {
  3299.             CloseHandle(CallBackTransfer);
  3300.             return;
  3301.         }
  3302.         char userid[15];
  3303.         GetMenuItem(CallBackTransfer, option, userid, 15);
  3304.         int target = GetClientOfUserId(StringToInt(userid));
  3305.         if (bIsSurvivor(target))
  3306.         {
  3307.             DisplayTransferSecondPart(client);
  3308.             Target[client] = target;
  3309.         }
  3310.     }
  3311.     if(action == MenuAction_Cancel)
  3312.     {
  3313.         if(option == MenuEnd_ExitBack)
  3314.         {
  3315.             DisplayMainMenu(client)
  3316.         }
  3317.     }
  3318. }
  3319.  
  3320. public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
  3321. {
  3322.     if(bIsSurvivor(client))
  3323.     {
  3324.         if(DoubleJump[client])
  3325.         {
  3326.             Jump(client);
  3327.         }
  3328.     }
  3329. }
  3330.  
  3331. stock bool IsValidInfected(int client)
  3332. {
  3333.     if ( client < 1 || client > MaxClients ) return false;
  3334.     if ( !IsClientConnected( client )) return false;
  3335.     if ( !IsClientInGame( client )) return false;
  3336.     if ( GetClientTeam( client ) != 3 ) return false;
  3337.     return true;
  3338. }
  3339.  
  3340. stock bool IsWitch(int entity)
  3341. {
  3342.     if (entity > 0 && IsValidEntity(entity) && IsValidEdict(entity))
  3343.     {
  3344.         char entType[64];
  3345.         GetEdictClassname(entity, entType, sizeof(entType));
  3346.         return StrEqual(entType, "witch");
  3347.     }
  3348.     return false;
  3349. }
  3350.  
  3351. stock void Jump(int client)
  3352. {
  3353.     int fCurFlags = GetEntityFlags(client);
  3354.     int fCurButtons = GetClientButtons(client);
  3355.  
  3356.     if (g_fLastFlags[client] & FL_ONGROUND)
  3357.     {
  3358.         if (!(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
  3359.         {
  3360.             OriginalJump(client);
  3361.         }
  3362.     }
  3363.     else if (fCurFlags & FL_ONGROUND)
  3364.     {
  3365.         Landed(client);
  3366.     }
  3367.     else if (!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
  3368.     {
  3369.         ReJump(client);
  3370.     }
  3371.    
  3372.     g_fLastFlags[client] = fCurFlags;
  3373.     g_fLastButtons[client] = fCurButtons;
  3374. }
  3375.  
  3376. stock void OriginalJump(const any client)
  3377. {
  3378.     g_iJumps[client]++;
  3379. }
  3380.  
  3381. stock void Landed(const any client)
  3382. {
  3383.     g_iJumps[client] = 0;
  3384. }
  3385.  
  3386. stock void ReJump(const any client)
  3387. {
  3388.     if ( 1 <= g_iJumps[client] <= g_iJumpMax)
  3389.     {                      
  3390.         g_iJumps[client]++;
  3391.         float vVel[3];
  3392.         GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);
  3393.        
  3394.         vVel[2] = 300.0;
  3395.         TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);
  3396.     }
  3397. }
  3398.  
  3399. stock void ForceDamageEntity(int causer, int damage, int victim) // thanks to 达斯*维达
  3400. {
  3401.     float victim_origin[3];
  3402.     char rupture[32];
  3403.     char damage_victim[32];
  3404.     IntToString(damage, rupture, sizeof(rupture));
  3405.     Format(damage_victim, sizeof(damage_victim), "hurtme%d", victim);
  3406.     GetEntPropVector(victim, Prop_Send, "m_vecOrigin", victim_origin);
  3407.     int entity = CreateEntityByName("point_hurt");
  3408.     DispatchKeyValue(victim, "targetname", damage_victim);
  3409.     DispatchKeyValue(entity, "DamageTarget", damage_victim);
  3410.     DispatchKeyValue(entity, "Damage", rupture);
  3411.     DispatchSpawn(entity);
  3412.     TeleportEntity(entity, victim_origin, NULL_VECTOR, NULL_VECTOR);
  3413.     AcceptEntityInput(entity, "Hurt", (causer > 0 && causer <= MaxClients) ? causer : -1);
  3414.     DispatchKeyValue(entity, "classname", "point_hurt");
  3415.     DispatchKeyValue(victim, "targetname", "null");
  3416.     AcceptEntityInput(entity, "Kill");
  3417. }
  3418.  
  3419. stock bool IsPlayerIncaped(int client)
  3420. {
  3421.     return view_as<bool>(GetEntProp(client, Prop_Send, "m_isIncapacitated"));
  3422. }
  3423.  
  3424. stock bool bIsSurvivor(int client)
  3425. {
  3426.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  3427. }
  3428.  
  3429. stock bool IsCommonInfected(int entity)
  3430. {
  3431.     if (entity > 0 && IsValidEntity(entity) && IsValidEdict(entity))
  3432.     {
  3433.         char entType[64];
  3434.         GetEdictClassname(entity, entType, sizeof(entType));
  3435.         return StrEqual(entType, "infected");
  3436.     }
  3437.     return false;
  3438. }
  3439.  
  3440. /*
  3441. bool IsRock(int entity)
  3442. {
  3443.     if (IsValidEntity(entity))
  3444.     {
  3445.         char sClass[36];
  3446.         GetEntityClassname(entity, sClass, sizeof(sClass));
  3447.         return StrEqual(sClass, "tank_rock");
  3448.     }
  3449.     return false;
  3450. }
  3451. */
  3452. /*
  3453. public void ScreenFade(int target, int red, int green, int blue, int alpha, int duration, int type)
  3454. {
  3455.     Handle msg = StartMessageOne("Fade", target);
  3456.     BfWriteShort(msg, 500);
  3457.     BfWriteShort(msg, duration);
  3458.     if (type == 0)
  3459.     {
  3460.         BfWriteShort(msg, (0x0002 | 0x0008));
  3461.     }
  3462.     else
  3463.     {
  3464.         BfWriteShort(msg, (0x0001 | 0x0010));
  3465.     }
  3466.     BfWriteByte(msg, red);
  3467.     BfWriteByte(msg, green);
  3468.     BfWriteByte(msg, blue);
  3469.     BfWriteByte(msg, alpha);
  3470.     EndMessage();
  3471. }
  3472.  
  3473. public void ScreenShake(int target, float power)
  3474. {
  3475.     Handle msg;
  3476.     msg = StartMessageOne("Shake", target);
  3477.     BfWriteByte(msg, 0);
  3478.     BfWriteFloat(msg, power);
  3479.     BfWriteFloat(msg, 10.0);
  3480.     BfWriteFloat(msg, 3.0);
  3481.     EndMessage();
  3482. }
  3483. */
  3484.  
  3485. public void LittleFlower(float pos[3], int type) //thanks to ztar
  3486. {
  3487.     int entity = CreateEntityByName("prop_physics");
  3488.     if (IsValidEntity(entity))
  3489.     {
  3490.         pos[2] += 10.0;
  3491.         if (type == 0)
  3492.             DispatchKeyValue(entity, "model", "models/props_junk/gascan001a.mdl");
  3493.         else
  3494.             DispatchKeyValue(entity, "model", "models/props_junk/propanecanister001a.mdl");
  3495.         DispatchSpawn(entity);
  3496.         SetEntData(entity, GetEntSendPropOffs(entity, "m_CollisionGroup"), 1, 1, true);
  3497.         TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
  3498.         AcceptEntityInput(entity, "break");
  3499.     }
  3500. }
  3501.  
  3502. void GiveFunction(int client, char[] name)
  3503. {
  3504.     char sBuf[32];
  3505.     int flags = GetCommandFlags("give");
  3506.     SetCommandFlags("give", flags & ~FCVAR_CHEAT);
  3507.     FormatEx(sBuf, sizeof sBuf, "give %s", name);
  3508.     FakeClientCommand(client, sBuf);
  3509. }
  3510.  
  3511. stock bool IsInGame(int client)
  3512. {
  3513.     if ( client < 1 || client > MaxClients ) return false;
  3514.     if ( !IsClientConnected( client )) return false;
  3515.     if ( !IsClientInGame( client )) return false;
  3516.     return true;
  3517. }
  3518.  
  3519. stock bool IsPipe(int entity)
  3520. {
  3521.     if(IsValidEntity(entity))
  3522.     {
  3523.         char sWeaponEx[32];
  3524.         GetEntityClassname(entity, sWeaponEx, sizeof(sWeaponEx));
  3525.         return StrEqual(sWeaponEx, "pipe_bomb_projectile");
  3526.     }
  3527.     return false;
  3528. }
  3529.  
  3530. int GetGrenade(int iClient)
  3531. {
  3532.     char sClass[32] = {"pipe_bomb_projectile"};
  3533.     for(int i = 0, iGrenade = -1; i < sizeof(sClass); i++)
  3534.     {
  3535.         while((iGrenade = FindEntityByClassname(iGrenade, sClass[i])) != -1)
  3536.         {
  3537.             if(IsPipe(iGrenade) && iGrenade > 0)
  3538.             {
  3539.                 if(GetEntPropEnt(iGrenade, Prop_Send, "m_hThrower") == iClient)
  3540.                     return iGrenade;
  3541.             }
  3542.         }
  3543.     }
  3544.     return 0;
  3545. }
  3546.  
  3547. stock bool IsValidClient(int client)
  3548. {
  3549.     if ( client < 1 || client > MaxClients ) return false;
  3550.     if ( !IsClientConnected( client )) return false;
  3551.     if ( !IsClientInGame( client )) return false;
  3552.     if ( GetClientTeam( client ) != 2 ) return false;
  3553.     if ( !IsPlayerAlive( client )) return false;
  3554.     return true;
  3555. }
  3556.  
  3557. int GetColor(Handle hCvar)
  3558. {
  3559.     char sTemp[12];
  3560.     GetConVarString(hCvar, sTemp, sizeof(sTemp));
  3561.    
  3562.     if( StrEqual(sTemp, "") )
  3563.         return 0;
  3564.  
  3565.     char sColors[3][4];
  3566.     int color = ExplodeString(sTemp, " ", sColors, 3, 4);
  3567.  
  3568.     if( color != 3 )
  3569.         return 0;
  3570.  
  3571.     color = StringToInt(sColors[0]);
  3572.     color += 256 * StringToInt(sColors[1]);
  3573.     color += 65536 * StringToInt(sColors[2]);
  3574.  
  3575.     return color;
  3576. }
  3577.  
  3578. void MagStart(int iEntid, int client)
  3579. {
  3580.     float flGameTime = GetGameTime();
  3581.     float flNextTime_ret = GetEntDataFloat(iEntid,iNextPrimaryAt);
  3582.     float flNextTime_calc = ( flNextTime_ret - flGameTime ) * flRate ;
  3583.     SetEntDataFloat(iEntid, iPlayRate, 1.0/flRate, true);
  3584.     CreateTimer( flNextTime_calc, Timer_MagEnd, iEntid);
  3585.     Handle hPack = CreateDataPack();
  3586.     WritePackCell(hPack, client);
  3587.     float flStartTime_calc = flGameTime - ( flNextTime_ret - flGameTime ) * ( 1 - flRate );
  3588.     WritePackFloat(hPack, flStartTime_calc);
  3589.     if ( (flNextTime_calc - 0.4) > 0 )
  3590.         CreateTimer( flNextTime_calc - 0.4 , Timer_MagEnd2, hPack);
  3591.     flNextTime_calc += flGameTime;
  3592.     SetEntDataFloat(iEntid, iTimeIdle, flNextTime_calc, true);
  3593.     SetEntDataFloat(iEntid, iNextPrimaryAt, flNextTime_calc, true);
  3594.     SetEntDataFloat(client, iNextAt, flNextTime_calc, true);
  3595. }
  3596.  
  3597. public Action Timer_MagEnd(Handle timer, any iEntid)
  3598. {
  3599.     KillTimer(timer);
  3600.     if (IsServerProcessing()==false)
  3601.         return Plugin_Stop;
  3602.  
  3603.     if (iEntid <= 0
  3604.         || IsValidEntity(iEntid)==false)
  3605.         return Plugin_Stop;
  3606.  
  3607.     SetEntDataFloat(iEntid, iPlayRate, 1.0, true);
  3608.  
  3609.     return Plugin_Stop;
  3610. }
  3611.  
  3612. public Action Timer_MagEnd2(Handle timer, Handle hPack)
  3613. {
  3614.     KillTimer(timer);
  3615.     if (IsServerProcessing()==false)
  3616.     {
  3617.         CloseHandle(hPack);
  3618.         return Plugin_Stop;
  3619.     }
  3620.  
  3621.     ResetPack(hPack);
  3622.     int iCid = ReadPackCell(hPack);
  3623.     float flStartTime_calc = ReadPackFloat(hPack);
  3624.     CloseHandle(hPack);
  3625.  
  3626.     if (iCid <= 0
  3627.         || IsValidEntity(iCid)==false
  3628.         || IsClientInGame(iCid)==false)
  3629.         return Plugin_Stop;
  3630.  
  3631.     int iVMid = GetEntDataEnt2(iCid,iViewModel);
  3632.     SetEntDataFloat(iVMid, iVMStartTime, flStartTime_calc, true);
  3633.  
  3634.     return Plugin_Stop;
  3635. }
  3636.  
  3637. void GiveUpgrade(int client, int iType)
  3638. {
  3639.     int flags = GetCommandFlags("upgrade_add");
  3640.     SetCommandFlags("upgrade_add", flags & ~FCVAR_CHEAT);
  3641.     if(iType == 1)
  3642.     {
  3643.         FakeClientCommand(client, "upgrade_add explosive_ammo");
  3644.     }
  3645.     else if(iType == 2)
  3646.     {
  3647.         FakeClientCommand(client, "upgrade_add incendiary_ammo");
  3648.     }
  3649.     else if(iType == 3)
  3650.     {
  3651.         FakeClientCommand(client, "upgrade_add laser_sight");
  3652.     }
  3653.     SetCommandFlags("upgrade_add", flags|FCVAR_CHEAT);
  3654. }
  3655.  
  3656. /* I will need this soon
  3657. stock void CreateParticle(int client, char[] Particle_Name, bool Parent, float duration)
  3658. {
  3659.     float pos[3]; char sName[64], sTargetName[64];
  3660.     int Particle = CreateEntityByName("info_particle_system");
  3661.     GetClientAbsOrigin(client, pos);
  3662.     TeleportEntity(Particle, pos, NULL_VECTOR, NULL_VECTOR);
  3663.     DispatchKeyValue(Particle, "effect_name", Particle_Name);
  3664.    
  3665.     if(Parent)
  3666.     {
  3667.         int userid = GetClientUserId(client);
  3668.         Format(sName, sizeof(sName), "%d", userid+25);
  3669.         DispatchKeyValue(client, "targetname", sName);
  3670.         GetEntPropString(client, Prop_Data, "m_iName", sName, sizeof(sName));
  3671.        
  3672.         Format(sTargetName, sizeof(sTargetName), "%d", userid+1000);
  3673.         DispatchKeyValue(Particle, "targetname", sTargetName);
  3674.         DispatchKeyValue(Particle, "parentname", sName);
  3675.     }
  3676.     DispatchSpawn(Particle);
  3677.     DispatchSpawn(Particle);
  3678.     if(Parent)
  3679.     {
  3680.         SetVariantString(sName);
  3681.         AcceptEntityInput(Particle, "SetParent", Particle, Particle);
  3682.     }
  3683.     ActivateEntity(Particle);
  3684.     AcceptEntityInput(Particle, "start");
  3685.     CreateTimer(duration, timerStopAndRemoveParticle, Particle, TIMER_FLAG_NO_MAPCHANGE);
  3686. }
  3687.  
  3688. public Action timerStopAndRemoveParticle(Handle timer, any entity)
  3689. {
  3690.     if(entity > 0 && IsValidEntity(entity) && IsValidEdict(entity))
  3691.     {
  3692.         AcceptEntityInput(entity, "Kill");
  3693.     }
  3694. }
  3695. */
Advertisement
Add Comment
Please, Sign In to add comment