FlacoBey

Untitled

May 29th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 62.66 KB | None | 0 0
  1. // SMLib doesn't use new style syntax //What to do then?
  2. #include <smlib>
  3.  
  4. #pragma semicolon 1
  5. #pragma newdecls required
  6.  
  7. #include <sourcemod>
  8. #include <sdktools>
  9. #include <sdkhooks>
  10. #include <skills>
  11.  
  12. #if SOURCEMOD_V_MINOR < 7
  13.     #error Sourcemod version is too old!!
  14. #endif
  15.  
  16. #define iTake   "ui/bigreward.wav"
  17.  
  18. public Plugin myinfo=
  19. {
  20.     name = "Skills.Core",
  21.     author = "BHaType & Silvers",
  22.     description = "Выжившие могу покупать скилы и перки.",
  23.     version = "6.7.1",
  24.     url = "https://steamcommunity.com/id/fallinourblood/"
  25. };
  26.  
  27. /*
  28. enum vEnums
  29. {
  30.     CostAntiDamage,
  31.     CostEpicMoli,
  32.     CostFastReload,
  33.     CostHelpingHand,
  34.     CostMeleeDamage,
  35.     CostShoveDamage,
  36.     CostPipeIndixite,
  37.     CostSpeedUp,
  38.     CostUltraPipe,
  39.     CostDoubleJump,
  40.     CostMinecraft
  41. }
  42. */
  43.  
  44. ConVar ResetEveryMap;
  45.  
  46. ConVar NeedToCraftPills, NeedToCraftAdrenaline, CostEpicMoli, CostEpicMoliUpgrade, CostHelpingHand, CostDoubleJump, CostSpeedUp, CostUpgradePipe,
  47.        CostUltraPipe, CostPipeIndixite, CostShoveDamage, CostAntiDamage, CostMeleeDamage, CostFastReload, CostExpAmmo, CostIncAmmo, CostLaserSight,
  48.        CostExpAmmoPack, CostIncAmmoPack, CostMinecraft, NeedToCraftDefib, NeedToCraftGnome, NeedToCraftMedkit;
  49.  
  50. int g_iArrayCostList[12];
  51.  
  52. bool g_GlobalEnabledBool[MAXPLAYERS+1][12];
  53.  
  54. int Cash[MAXPLAYERS + 1] = 0;
  55. int TeamCash = 5000;
  56. int CI[MAXPLAYERS+1] = 0;
  57. int Target[MAXPLAYERS + 1] = 0;
  58.  
  59. int iCountMedkits[MAXPLAYERS + 1];
  60. int iCraftedMedkits[MAXPLAYERS+1];
  61.  
  62. int iCountAdrenalins[MAXPLAYERS + 1] = 0;
  63. int iCraftedAdrenalins[MAXPLAYERS + 1] = 0;
  64.  
  65. int iCountPills[MAXPLAYERS + 1] = 0;
  66. int iCraftedPills[MAXPLAYERS + 1] = 0;
  67.  
  68. int iCountDebifs[MAXPLAYERS + 1] = 0;
  69. int iCraftedDebifs[MAXPLAYERS + 1] = 0;
  70.  
  71. int iCountGnomes[MAXPLAYERS + 1] = 0;
  72. int iCraftedGnomes[MAXPLAYERS + 1] = 0;
  73.  
  74. int iEveryOneAdrenalins = 0;
  75. int iEveryOnePills = 0;
  76. int iEveryOneMedkit = 0;
  77. int iEveryOneDeffibrilator = 0;
  78. int iEveryOneGnome = 0;
  79.  
  80. Handle vHealUpTeam = null;
  81. Handle vPoisonTeam = null;
  82. Handle vTimerAdver[MAXPLAYERS+1] = null;
  83.  
  84. char sMap[64];
  85.  
  86. int vLvLPipes[MAXPLAYERS + 1] = 1;
  87. int vMaxLvLPipes = 5;
  88.  
  89. int iMaxLevelMolo = 6;
  90.  
  91. int iCountOfMoliks[MAXPLAYERS + 1] = 1;
  92.  
  93. bool IsHelpHand;
  94. bool Speed_Up;
  95. bool Ultra_Pipe_Bomb;
  96. bool Pipa_Velcro;
  97. bool Perfect_Shove;
  98. bool Fast_Reload;
  99. bool Anti_Damage;
  100. bool MeleeDamage;
  101. bool Epic_Molotov;
  102. bool Double_Jump;
  103. bool Crafting;
  104.  
  105. //int iModuleId;
  106. //Handle g_hGlobalForwardRequest;
  107.  
  108. public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
  109. {
  110.     RegPluginLibrary("Skills.Core");
  111.     RegPluginLibrary("Skills.Anti_Damage");
  112.     RegPluginLibrary("Skills.Epic_Molotov");
  113.     RegPluginLibrary("Skills.Fast_Reload");
  114.     RegPluginLibrary("Skills.Helpin_Hand");
  115.     RegPluginLibrary("Skills.MeleeDamage");
  116.     RegPluginLibrary("Skills.Perfect_Shove");
  117.     RegPluginLibrary("Skills.Pipa_Velcro");
  118.     RegPluginLibrary("Skills.SpeedUp");
  119.     RegPluginLibrary("Skills.Ultra_Pipe_Bomb");
  120.     RegPluginLibrary("Skills.Crafting");
  121.     RegPluginLibrary("Skills.Double_Jump");
  122.     //g_hGlobalForwardRequest = CreateGlobalForward("OnSkillRequest", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
  123.     CreateNative("SetSkillArrayValue", fncSetSkillArrayValue);
  124.     CreateNative("GetStatePerk", PerkGetState);
  125.     //CreateNative("SetCostArrayValue", NAT_SetCostArray);
  126.     return APLRes_Success;
  127. }
  128.  
  129. /*
  130. pblic int NAT_SetCostArray(Handle plugin, int numParams)
  131. {
  132.     int iArray = GetNativeCell(1);
  133.     int iCount = GetNativeCell(2);
  134.     g_iArrayCostList[iArray] = iCount;
  135. }
  136. */
  137.  
  138. public int PerkGetState(Handle plugin, int numParams)
  139. {
  140.     int client = GetNativeCell(1);
  141.     int PerkId = GetNativeCell(2);
  142.  
  143.     return g_GlobalEnabledBool[client][PerkId];
  144. }
  145.  
  146.  
  147. public int fncSetSkillArrayValue(Handle plugin, int numParams)
  148. {
  149.     int client = GetNativeCell(1);
  150.     int type = GetNativeCell(2);
  151.  
  152.     switch(type)
  153.     {
  154.         case 0:     iCountGnomes[client]++;
  155.         case 1:     iCountAdrenalins[client]++;
  156.         case 2:     iCountDebifs[client]++
  157.         case 3:     iCountPills[client]++;
  158.         case 4:     iCountMedkits[client]++;
  159.     }
  160. }
  161.  
  162. public void OnLibraryRemoved(const char[] name)
  163. {
  164.     if (strcmp(name, "Skills.Helpin_Hand") == 0)
  165.     {
  166.         //iModuleId = 4;
  167.         IsHelpHand = false;
  168.     }
  169.     else if (strcmp(name, "Skills.SpeedUp") == 0)
  170.     {
  171.         //iModuleId = 8;
  172.         Speed_Up = false;
  173.     }
  174.     else if (strcmp(name, "Skills.Ultra_Pipe_Bomb") == 0)
  175.     {
  176.         //iModuleId = 9;
  177.         Ultra_Pipe_Bomb = false;
  178.     }
  179.     else if (strcmp(name, "Skills.Pipa_Velcro") == 0)
  180.     {
  181.         //iModuleId = 7;
  182.         Pipa_Velcro = false;
  183.     }
  184.     else if (strcmp(name, "Skills.Perfect_Shove") == 0)
  185.     {
  186.         //iModuleId = 6;
  187.         Perfect_Shove = false;
  188.     }
  189.     else if (strcmp(name, "Skills.Fast_Reload") == 0)
  190.     {
  191.         //iModuleId = 3;
  192.         Fast_Reload = false;
  193.     }
  194.     else if (strcmp(name, "Skills.Anti_Damage") == 0)
  195.     {
  196.         //iModuleId = 1;
  197.         Anti_Damage = false;
  198.     }
  199.     else if (strcmp(name, "Skills.MeleeDamage") == 0)
  200.     {
  201.         //iModuleId = 5;
  202.         MeleeDamage = false;
  203.     }
  204.     else if (strcmp(name, "Skills.Double_Jump") == 0)
  205.     {
  206.         //iModuleId = 10;
  207.         Double_Jump = false;
  208.     }
  209.     else if (strcmp(name, "Skills.Epic_Molotov") == 0)
  210.     {
  211.         //iModuleId = 2;
  212.         Epic_Molotov = false;
  213.     }
  214.     else if (strcmp(name, "Skills.Crafting") == 0)
  215.     {
  216.         //iModuleId = 11;
  217.         Crafting = false;
  218.     }
  219.  
  220.     //Call_StartForward(g_hGlobalForwardRequest);
  221.     //Call_PushCell(0);
  222.     //Call_PushCell(iModuleId);
  223.     //Call_PushCell(false);
  224.     //Call_Finish();
  225. }
  226.  
  227. public void OnLibraryAdded(const char[] name)
  228. {
  229.     if (strcmp(name, "Skills.Helpin_Hand") == 0)
  230.     {
  231.         //iModuleId = 4;
  232.         IsHelpHand = true;
  233.     }
  234.     else if (strcmp(name, "Skills.SpeedUp") == 0)
  235.     {
  236.         //iModuleId = 8;
  237.         Speed_Up = true;
  238.     }
  239.     else if (strcmp(name, "Skills.Ultra_Pipe_Bomb") == 0)
  240.     {
  241.         //iModuleId = 9;
  242.         Ultra_Pipe_Bomb = true;
  243.     }
  244.     else if (strcmp(name, "Skills.Pipa_Velcro") == 0)
  245.     {
  246.         //iModuleId = 7;
  247.         Pipa_Velcro = true;
  248.     }
  249.     else if (strcmp(name, "Skills.Perfect_Shove") == 0)
  250.     {
  251.         //iModuleId = 6;
  252.         Perfect_Shove = true;
  253.     }
  254.     else if (strcmp(name, "Skills.Fast_Reload") == 0)
  255.     {
  256.         //iModuleId = 3;
  257.         Fast_Reload = true;
  258.     }
  259.     else if (strcmp(name, "Skills.Anti_Damage") == 0)
  260.     {
  261.         //iModuleId = 1;
  262.         Anti_Damage = true;
  263.     }
  264.     else if (strcmp(name, "Skills.MeleeDamage") == 0)
  265.     {
  266.         //iModuleId = 5;
  267.         MeleeDamage = true;
  268.     }
  269.     else if (strcmp(name, "Skills.Double_Jump") == 0)
  270.     {
  271.         //iModuleId = 10;
  272.         Double_Jump = true;
  273.     }
  274.     else if (strcmp(name, "Skills.Epic_Molotov") == 0)
  275.     {
  276.         //iModuleId = 2;
  277.         Epic_Molotov = true;
  278.     }
  279.     else if (strcmp(name, "Skills.Crafting") == 0)
  280.     {
  281.         //iModuleId = 11;
  282.         Crafting = true;
  283.     }
  284. }
  285.  
  286. public void OnPluginStart()
  287. {
  288.     RegAdminCmd("sm_core", Sm_core, ADMFLAG_ROOT);
  289.     RegConsoleCmd("sm_up", BuyMenu);
  290.     RegConsoleCmd("sm_cr", CraftMenu);
  291.     RegAdminCmd("sm_gm", Gm, ADMFLAG_ROOT);
  292.  
  293.     ResetEveryMap           =   CreateConVar("vHardReset","0",  "Каждую карту будет сброс перков и денег // (1/0)", FCVAR_NONE);
  294.  
  295.     CostHelpingHand         =   CreateConVar("vCostHelpHand","16000",       "Стоимость перка // Helping Hand", FCVAR_NONE);
  296.     CostDoubleJump          =   CreateConVar("vCostDoubleJump","14000",     "Стоимость перка // Double Jump", FCVAR_NONE);
  297.     CostSpeedUp             =   CreateConVar("vCostSpeedUp","18000",        "Стоимость перка // Speed Up", FCVAR_NONE);
  298.     CostAntiDamage          =   CreateConVar("vCostAntiDamage","10000",     "Стоимость перка // Anti Damage", FCVAR_NONE);
  299.     CostMeleeDamage         =   CreateConVar("vCostMeleeDamage","14000",    "Стоимость перка // Melee Damage", FCVAR_NONE);
  300.     CostFastReload          =   CreateConVar("vCostFastReload","17500",     "Стоимость перка // Fast Reload", FCVAR_NONE);
  301.  
  302.     CostExpAmmoPack         =   CreateConVar("vCostExpAmmoPack","3500",     "Стоимость осколочных патронов // Pack", FCVAR_NONE);
  303.     CostIncAmmoPack         =   CreateConVar("vCostIncAmmoPack","3500",     "Стоимость зажигательных патронов // Pack", FCVAR_NONE);
  304.     CostExpAmmo             =   CreateConVar("vCostExpAmmo","3000",         "Стоимость осколочных патронов", FCVAR_NONE);
  305.     CostIncAmmo             =   CreateConVar("vCostIncAmmo","3000",         "Стоимость зажигательных патронов", FCVAR_NONE);
  306.     CostLaserSight          =   CreateConVar("vCostLaserSight","2000",      "Стоимость лазера", FCVAR_NONE);
  307.  
  308.     CostEpicMoli            =   CreateConVar("vCostEpicMolo","17000",       "Стоимость перка // Epic Moli", FCVAR_NONE);
  309.     CostEpicMoliUpgrade     =   CreateConVar("vCostEpicMoloUpgrade","3500", "Стоимость апгрейда перка // Epic Moli", FCVAR_NONE);
  310.  
  311.     NeedToCraftGnome        =   CreateConVar("vNumberToCraftGnome","60",    "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
  312.     NeedToCraftDefib        =   CreateConVar("vNumberToCraftDefib","30",    "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
  313.     NeedToCraftAdrenaline   =   CreateConVar("vNumberToCraftAdrenaline","10",   "Сколько нужно частей чтобы скрафтить адреналин", FCVAR_NONE);
  314.     NeedToCraftPills        =   CreateConVar("vNumberToCraftPills","10",    "Сколько нужно частей чтобы скрафтить таблетки", FCVAR_NONE);
  315.     NeedToCraftMedkit       =   CreateConVar("vNumberToCraftMedkit","20",   "Сколько нужно частей чтобы скрафтить аптечку", FCVAR_NONE);
  316.  
  317.     CostMinecraft           =   CreateConVar("vCostCraftPerk","11000",      "Стоимость перка // Craft", FCVAR_NONE);
  318.     CostUpgradePipe         =   CreateConVar("vCostUpgradePipe","2500",     "Стоимость апгрейда перка // Ultra Pipe Bomb", FCVAR_NONE);
  319.     CostUltraPipe           =   CreateConVar("vCostUltraPipe","20000",      "Стоимость перка // Ultra Pipe", FCVAR_NONE);
  320.     CostPipeIndixite        =   CreateConVar("vCostStickyPipes","250",      "Стоимость перка // Sticky Pipes", FCVAR_NONE);
  321.     CostShoveDamage         =   CreateConVar("vCostPerfectDamage","12999",  "Стоимость перка // Perfect Shove", FCVAR_NONE);
  322.  
  323.     SetArrayValues();
  324.     AutoExecConfig(true, "L4D2_Skills");
  325.     LoadTranslations("Skills.phrases");
  326. }
  327.  
  328. public void OnMapStart()
  329. {
  330.     if(GetConVarInt(ResetEveryMap) == 0)
  331.     {
  332.         GetCurrentMap(sMap, sizeof(sMap));
  333.         if(StrContains(sMap, "m1_", true) > 1)
  334.         {
  335.             for(int i = 0; i <= MaxClients; ++i)
  336.             {
  337.                 Cash[i] = 0;
  338.                 TeamCash = 5000;
  339.                 CI[i] = 0;
  340.  
  341.                 if(vTimerAdver[i] != null)
  342.                 {
  343.                     KillTimer(vTimerAdver[i]);
  344.                     vTimerAdver[i] = null;
  345.                 }
  346.                 if(vTimerAdver[i] != null)
  347.                 {
  348.                     KillTimer(vTimerAdver[i]);
  349.                     vTimerAdver[i] = null;
  350.                 }
  351.                 iCraftedAdrenalins[i] = 0;
  352.                 iCountAdrenalins[i]
  353.                 iCountPills[i] = 0;
  354.                 iCraftedPills[i] = 0;
  355.                 iCraftedMedkits[i] = 0;
  356.                 iCountMedkits[i] = 0;
  357.             }
  358.             ResetAllPerks();
  359.             if(vHealUpTeam != null)
  360.             {
  361.                 KillTimer(vHealUpTeam);
  362.                 vHealUpTeam = null;
  363.             }
  364.         }
  365.     }
  366.     int iCountMedkits[MAXPLAYERS + 1];
  367. int iCraftedMedkits[MAXPLAYERS+1];
  368.  
  369. int iCountAdrenalins[MAXPLAYERS + 1] = 0;
  370. int iCraftedAdrenalins[MAXPLAYERS + 1] = 0;
  371.  
  372. int iCountPills[MAXPLAYERS + 1] = 0;
  373. int iCraftedPills[MAXPLAYERS + 1] = 0;
  374.  
  375. int iCountDebifs[MAXPLAYERS + 1] = 0;
  376. int iCraftedDebifs[MAXPLAYERS + 1] = 0;
  377.  
  378. int iCountGnomes[MAXPLAYERS + 1] = 0;
  379. int iCraftedGnomes[MAXPLAYERS + 1] = 0;
  380.  
  381. int iEveryOneAdrenalins = 0;
  382. int iEveryOnePills = 0;
  383. int iEveryOneMedkit = 0;
  384. int iEveryOneDeffibrilator = 0;
  385. int iEveryOneGnome = 0;
  386.  
  387.     else
  388.     {
  389.         for(int i = 1; i <= MaxClients; ++i)
  390.         {
  391.             Cash[i] = 0;
  392.             TeamCash = 5000;
  393.             CI[i] = 0;
  394.  
  395.             if(vTimerAdver[i] != null)
  396.             {
  397.                 KillTimer(vTimerAdver[i]);
  398.                 vTimerAdver[i] = null;
  399.             }
  400.             iCountAdrenalins[i] = 0;
  401.             iCraftedAdrenalins[i] = 0;
  402.             iCountPills[i] = 0;
  403.             iCraftedPills[i] = 0;
  404.             iCraftedMedkits[i] = 0;
  405.             iCountMedkits[i] = 0;
  406.         }
  407.         ResetAllPerks();
  408.         if(vHealUpTeam != null)
  409.         {
  410.             KillTimer(vHealUpTeam);
  411.             vHealUpTeam = null;
  412.         }
  413.     }
  414.     if(vPoisonTeam != null)
  415.     {
  416.         KillTimer(vPoisonTeam);
  417.         vPoisonTeam = null;
  418.     }
  419. }
  420.  
  421. public Action Sm_core(int client, int args)
  422. {
  423.     PrintToChatAll("int g_iArrayCostList = %i", g_iArrayCostList[args]);
  424.     PrintToChatAll("bool IsHelpHand = %b", IsHelpHand);
  425.     PrintToChatAll("bool Speed_Up = %b", Speed_Up);
  426.     PrintToChatAll("bool Ultra_Pipe_Bomb = %b", Ultra_Pipe_Bomb);
  427.     PrintToChatAll("bool Pipa_Velcro = %b", Pipa_Velcro);
  428.     PrintToChatAll("bool Perfect_Shove = %b", Perfect_Shove);
  429.     PrintToChatAll("bool Fast_Reload = %b", Fast_Reload);
  430.     PrintToChatAll("bool Anti_Damage = %b", Anti_Damage);
  431.     PrintToChatAll("bool MeleeDamage = %b", MeleeDamage);
  432.     PrintToChatAll("bool Epic_Molotov = %b", Epic_Molotov);
  433.     PrintToChatAll("bool Double_Jump = %b", Double_Jump);
  434.     PrintToChatAll("bool Crafting = %b", Crafting);
  435. }
  436.  
  437. public Action CraftMenu(int client, int args)
  438. {
  439.     if(bIsSurvivor(client))
  440.     {
  441.         DisplayCraftMenu(client);
  442.     }
  443. }
  444.  
  445. public Action EventWitchKill(Event event, const char[] name, bool dontBroadcast)
  446. {
  447.     int attacker = GetClientOfUserId(GetEventInt(event,"userid"));
  448.  
  449.     if(bIsSurvivor(attacker))
  450.     {
  451.         int random = GetRandomInt(250, 2500) * 2;
  452.         Cash[attacker] += random;
  453.         Client_PrintToChat(attacker, true, "%t", "WitchKilled", random);
  454.         for(int i = 1; i <= MaxClients; ++i)
  455.         {
  456.             if(IsClientInGame(i) && i != attacker)
  457.             {
  458.                 Client_PrintToChat(i, true, "%t", "WhoWitchKilled", attacker, random);
  459.             }
  460.         }
  461.     }
  462. }
  463.  
  464. public Action EventInfDeath(Event event, const char[] name, bool dontBroadcast)
  465. {
  466.     int attacker = GetClientOfUserId(GetEventInt(event,"attacker"));
  467.  
  468.     if(vTimerAdver[attacker] == null)
  469.     {
  470.         vTimerAdver[attacker] = CreateTimer(70.0, Advertisement, attacker);
  471.     }
  472.     CI[attacker]++;
  473. }
  474.  
  475. public Action Advertisement(Handle timer, int attacker)
  476. {
  477.     int total = GetRandomInt(0, 30) * CI[attacker] * GetRandomInt(1, 3);
  478.     if(bIsSurvivor(attacker) && total != 1702257729 && CI[attacker] != 1702257729)
  479.     {
  480.         Client_PrintToChat(attacker, true, "%t", "AdvertisementHowManyCommonsKilled", total, CI[attacker]);
  481.     }
  482.     Cash[attacker] += total;
  483.     CI[attacker] = 0;
  484.     KillTimer(vTimerAdver[attacker]);
  485.     vTimerAdver[attacker] = null;
  486.  
  487. }
  488.  
  489. public Action EventDeath(Event event, const char[] name, bool dontBroadcast)
  490. {
  491.     int client = GetClientOfUserId(event.GetInt("userid"));
  492.     int attacker = GetClientOfUserId(event.GetInt("attacker"));
  493.     if(IsValidInfected(client))
  494.     {
  495.         if(bIsSurvivor(attacker))
  496.         {
  497.             int Number;
  498.             int vClass = GetEntProp(client, Prop_Send, "m_zombieClass");
  499.             switch(vClass)
  500.             {
  501.                 case 1:
  502.                 {
  503.                     float rFloat = GetRandomFloat(1.0, 2.5);
  504.                     Number = GetRandomInt(200, 625);
  505.                     int Total = RoundToCeil(Number * rFloat);
  506.                     Cash[attacker] += Total;
  507.                     Client_PrintToChat(attacker, true, "%t", "KilledSmoker", Total);
  508.                 }
  509.                 case 2:
  510.                 {
  511.                     float rFloat = GetRandomFloat(1.0, 4.0);
  512.                     Number = GetRandomInt(200, 300);
  513.                     int Total = RoundToCeil(Number * rFloat);
  514.                     Cash[attacker] += Total;
  515.                     Client_PrintToChat(attacker, true, "%t", "KilledBoomer", Total);
  516.                 }
  517.                 case 3:
  518.                 {
  519.                     float rFloat = GetRandomFloat(1.0, 3.0);
  520.                     Number = GetRandomInt(350, 475);
  521.                     int Total = RoundToCeil(Number * rFloat);
  522.                     Cash[attacker] += Total;
  523.                     Client_PrintToChat(attacker, true, "%t", "KilledHunter", Total);
  524.                 }
  525.                 case 4:
  526.                 {
  527.                     float rFloat = GetRandomFloat(1.0, 3.5);
  528.                     Number = GetRandomInt(150, 175);
  529.                     int Total = RoundToCeil(Number * rFloat);
  530.                     Cash[attacker] += Total;
  531.                     Client_PrintToChat(attacker, true, "%t", "KilledSpitter", Total);
  532.                 }
  533.                 case 5:
  534.                 {
  535.                     float rFloat = GetRandomFloat(1.0, 2.5);
  536.                     Number = GetRandomInt(200, 350);
  537.                     int Total = RoundToCeil(Number * rFloat);
  538.                     Cash[attacker] += Total;
  539.                     Client_PrintToChat(attacker, true, "%t", "KilledJockey", Total);
  540.                 }
  541.                 case 6:
  542.                 {
  543.                     float rFloat = GetRandomFloat(1.0, 3.5);
  544.                     Number = GetRandomInt(300, 650);
  545.                     int Total = RoundToCeil(Number * rFloat);
  546.                     Cash[attacker] += Total;
  547.                     Client_PrintToChat(attacker, true, "%t", "KilledCharger", Total);
  548.                 }
  549.                 case 8:
  550.                 {
  551.                     float rFloat = GetRandomFloat(1.0, 2.1);
  552.                     Number = GetRandomInt(2100, 2850);
  553.                     int Total = RoundToCeil(Number * rFloat);
  554.                     Cash[attacker] += Total;
  555.                     Client_PrintToChat(attacker, true, "%t", "KilledTank", Total);
  556.                 }
  557.             }
  558.             TeamCash += Number;
  559.         }
  560.     }
  561. }
  562.  
  563. public Action Gm(int client,int args)
  564. {
  565.     Cash[client] += 100000;
  566. }
  567.  
  568. public Action BuyMenu(int client,int args)
  569. {
  570.     if(bIsSurvivor(client))
  571.     {
  572.         DisplayMainMenu(client);
  573.     }
  574. }
  575.  
  576. public int MainBox(Handle DontLook, MenuAction action, int client, int symbol)
  577. {
  578.     if (action == MenuAction_End)
  579.     {
  580.         CloseHandle(DontLook);
  581.         return;
  582.     }
  583.     if (action == MenuAction_Select)
  584.     {
  585.         switch(symbol)
  586.         {
  587.             case 0:
  588.             {
  589.                 DisplayStatisticMenu(client);
  590.             }
  591.             case 1:
  592.             {
  593.                 DisplayPerksPassiveMenu(client);
  594.             }
  595.             case 2:
  596.             {
  597.                 DisplayPerksMenu(client);
  598.             }
  599.             case 3:
  600.             {
  601.                 DisplayTransfer(client);
  602.             }
  603.             case 4:
  604.             {
  605.                 DisplayBankTo(client);
  606.             }
  607.             case 5:
  608.             {
  609.                 DisplayTeamHelp(client);
  610.             }
  611.             case 6:
  612.             {
  613.                 DisplayShop(client);
  614.             }
  615.             case 7:
  616.             {
  617.                 DisplayCraftMenu(client);
  618.             }
  619.             case 8:
  620.             {
  621.                 DisplayInvectory(client);
  622.             }
  623.             case 9:
  624.             {
  625.                 DisplayBag(client);
  626.             }
  627.             case 10:
  628.             {
  629.                 DisplayEveryOneBag(client);
  630.             }
  631.         }
  632.     }
  633. }
  634.  
  635. void DisplayInvectory(int client)
  636. {
  637.     Handle BagDisplay = CreateMenu(MyInvMenu);
  638.     //char sTitle[56];
  639.     SetMenuTitle(BagDisplay, "%t", "InvectoryMenuTitle");
  640.  
  641.     char sStringEx[128];
  642.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountMedkits", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit));
  643.     AddMenuItem(BagDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
  644.  
  645.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountPills", iCountPills[client], GetConVarInt(NeedToCraftPills));
  646.     AddMenuItem(BagDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  647.  
  648.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountAdrenalins", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline));
  649.     AddMenuItem(BagDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  650.  
  651.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDefibs", iCountDebifs[client], GetConVarInt(NeedToCraftDefib));
  652.     AddMenuItem(BagDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  653.  
  654.     Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDwarfs", iCountGnomes[client], GetConVarInt(NeedToCraftGnome));
  655.     AddMenuItem(BagDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  656.  
  657.     SetMenuExitBackButton(BagDisplay, true);
  658.     SetMenuExitButton(BagDisplay, true);
  659.     DisplayMenu(BagDisplay, client, MENU_TIME_FOREVER);
  660. }
  661.  
  662. public int MyInvMenu(Handle MinecraftCallback, MenuAction action, int client, int symbol)
  663. {
  664.     if (action == MenuAction_End)
  665.     {
  666.         CloseHandle(MinecraftCallback);
  667.         return;
  668.     }
  669.     if(action == MenuAction_Cancel)
  670.     {
  671.         if(symbol == MenuCancel_ExitBack)
  672.         {
  673.             DisplayMainMenu(client);
  674.         }
  675.     }
  676. }
  677.  
  678. public int MyBagMenu(Handle BagCallback, MenuAction action, int client, int symbol)
  679. {
  680.     if (action == MenuAction_End)
  681.     {
  682.         CloseHandle(BagCallback);
  683.         return;
  684.     }
  685.  
  686.     switch(symbol)
  687.     {
  688.         case 0:
  689.         {
  690.             if(iCraftedMedkits[client] > 0)
  691.             {
  692.                 iCraftedMedkits[client]--;
  693.                 GiveFunction(client, "first_aid_kit");
  694.                 Client_PrintToChat(client, true, "%t", "YouTakeFromBagMedkit", iCraftedMedkits[client]);
  695.             }
  696.             else
  697.             {
  698.                 Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedMedkits");
  699.             }
  700.         }
  701.         case 1:
  702.         {
  703.             if(iCraftedPills[client] > 0)
  704.             {
  705.                 iCraftedPills[client]--;
  706.                 GiveFunction(client, "pain_pills");
  707.                 Client_PrintToChat(client, true, "%t", "YouTakeFromBagPills", iCraftedPills[client]);
  708.             }
  709.             else
  710.             {
  711.                 Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedPills");
  712.             }
  713.         }
  714.         case 2:
  715.         {
  716.             if(iCraftedAdrenalins[client] > 0)
  717.             {
  718.                 iCraftedAdrenalins[client]--;
  719.                 GiveFunction(client, "adrenaline");
  720.                 Client_PrintToChat(client, true, "%t", "YouTakeFromBagAdrenaline", iCraftedAdrenalins[client]);
  721.             }
  722.             else
  723.             {
  724.                 Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedAdrenaline");
  725.             }
  726.         }
  727.         case 3:
  728.         {
  729.             if(iCraftedDebifs[client] > 0)
  730.             {
  731.                 iCraftedDebifs[client]--;
  732.                 GiveFunction(client, "defibrillator");
  733.                 Client_PrintToChat(client, true, "%t", "YouTakeFromBagDefib", iCraftedDebifs[client]);
  734.             }
  735.             else
  736.             {
  737.                 Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDefibs");
  738.             }
  739.         }
  740.         case 4:
  741.         {
  742.             if(iCraftedGnomes[client] > 0)
  743.             {
  744.                 iCraftedAdrenalins[client]--;
  745.                 GiveFunction(client, "gnome");
  746.                 Client_PrintToChat(client, true, "%t", "YouTakeFromBagDwarf", iCraftedGnomes[client]);
  747.             }
  748.             else
  749.             {
  750.                 Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDwarfs");
  751.             }
  752.         }
  753.     }
  754.     if(action == MenuAction_Cancel)
  755.     {
  756.         if(symbol == MenuCancel_ExitBack)
  757.         {
  758.             DisplayMainMenu(client);
  759.         }
  760.     }
  761. }
  762.  
  763. void DisplayEveryOneBag(int client)
  764. {
  765.     Handle MainMenuDisplay = CreateMenu(EveryOneDisplayBag);
  766.     //char sTitle[56];
  767.     SetMenuTitle(MainMenuDisplay, "%t", "EveryOneBag");
  768.  
  769.     char sStringEx[128];
  770.     Format(sStringEx, sizeof(sStringEx), "%t", "BagEveryOneTransfer", iEveryOneMedkit);
  771.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  772.  
  773.     if(iEveryOneMedkit > 0)
  774.     {
  775.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit);
  776.         AddMenuItem(MainMenuDisplay, "1", sStringEx);
  777.     }
  778.     else
  779.     {
  780.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit);
  781.         AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  782.     }
  783.  
  784.     if(iEveryOnePills > 0)
  785.     {
  786.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills);
  787.         AddMenuItem(MainMenuDisplay, "2", sStringEx);
  788.     }
  789.     else
  790.     {
  791.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills);
  792.         AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  793.     }
  794.  
  795.     if(iEveryOneAdrenalins > 0)
  796.     {
  797.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins);
  798.         AddMenuItem(MainMenuDisplay, "3", sStringEx);
  799.     }
  800.     else
  801.     {
  802.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins);
  803.         AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  804.     }
  805.  
  806.     if(iEveryOneDeffibrilator > 0)
  807.     {
  808.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator);
  809.         AddMenuItem(MainMenuDisplay, "4", sStringEx);
  810.     }
  811.     else
  812.     {
  813.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator);
  814.         AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  815.     }
  816.  
  817.     if(iEveryOneGnome > 0)
  818.     {
  819.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome);
  820.         AddMenuItem(MainMenuDisplay, "5", sStringEx);
  821.     }
  822.     else
  823.     {
  824.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome);
  825.         AddMenuItem(MainMenuDisplay, "5", sStringEx, ITEMDRAW_DISABLED);
  826.     }
  827.     SetMenuExitBackButton(MainMenuDisplay, true);
  828.     SetMenuExitButton(MainMenuDisplay, true);
  829.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  830. }
  831.  
  832. void DisplayEveryOneTransferint(int client)
  833. {
  834.     Handle MainMenuDisplay = CreateMenu(EvetyOneTransfer);
  835.     //char sTitle[56];
  836.     SetMenuTitle(MainMenuDisplay, "%t", "EveryoneBagTransfer");
  837.     char sStringEx[64];
  838.  
  839.     if(iCraftedMedkits[client] > 0)
  840.     {
  841.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
  842.         AddMenuItem(MainMenuDisplay, "0", sStringEx);
  843.     }
  844.     else
  845.     {
  846.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
  847.         AddMenuItem(MainMenuDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
  848.     }
  849.  
  850.     if(iCraftedPills[client] > 0)
  851.     {
  852.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
  853.         AddMenuItem(MainMenuDisplay, "1", sStringEx);
  854.     }
  855.     else
  856.     {
  857.         Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
  858.         AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  859.     }
  860.  
  861.     if(iCraftedAdrenalins[client] > 0)
  862.     {
  863.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
  864.         AddMenuItem(MainMenuDisplay, "2", sStringEx);
  865.     }
  866.     else
  867.     {
  868.         Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
  869.         AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
  870.     }
  871.  
  872.     if(iCraftedDebifs[client] > 0)
  873.     {
  874.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
  875.         AddMenuItem(MainMenuDisplay, "3", sStringEx);
  876.     }
  877.     else
  878.     {
  879.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
  880.         AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
  881.     }
  882.  
  883.     if(iCraftedGnomes[client] > 0)
  884.     {
  885.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
  886.         AddMenuItem(MainMenuDisplay, "4", sStringEx);
  887.     }
  888.     else
  889.     {
  890.         Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
  891.         AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
  892.     }
  893.  
  894.     SetMenuExitBackButton(MainMenuDisplay, true);
  895.     SetMenuExitButton(MainMenuDisplay, true);
  896.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  897. }
  898.  
  899. public int EvetyOneTransfer(Handle BagCallback, MenuAction action, int client, int symbol)
  900. {
  901.  
  902.     if (action == MenuAction_End)
  903.     {
  904.         CloseHandle(BagCallback);
  905.         return;
  906.     }
  907.  
  908.     switch(symbol)
  909.     {
  910.         case 0:
  911.         {
  912.             iCraftedMedkits[client]--;
  913.             iEveryOneMedkit++;
  914.             Client_PrintToChatAll(true, "%t", "SomeonePutMedkitToBagEveryone", client);
  915.         }
  916.         case 1:
  917.         {
  918.             iCraftedPills[client]--;
  919.             iEveryOneMedkit++;
  920.             Client_PrintToChatAll(true, "%t", "SomeonePutPillsToBagEveryone", client);
  921.         }
  922.         case 2:
  923.         {
  924.             iCraftedAdrenalins[client]--;
  925.             iEveryOneMedkit++;
  926.             Client_PrintToChatAll(true, "%t", "SomeonePutAdrenalineToBagEveryone", client);
  927.         }
  928.         case 3:
  929.         {
  930.             iCraftedDebifs[client]--;
  931.             iEveryOneMedkit++;
  932.             Client_PrintToChatAll(true, "%t", "SomeonePutDefibToBagEveryone", client);
  933.         }
  934.         case 4:
  935.         {
  936.             iCraftedGnomes[client]--;
  937.             iEveryOneMedkit++;
  938.             Client_PrintToChatAll(true, "%t", "SomeonePutGnomeToBagEveryone", client);
  939.         }
  940.     }
  941.     if(action == MenuAction_Cancel)
  942.     {
  943.         if(symbol == MenuCancel_ExitBack)
  944.         {
  945.             DisplayEveryOneBag(client);
  946.         }
  947.     }
  948. }
  949.  
  950. public int EveryOneDisplayBag(Handle BagCallback, MenuAction action, int client, int symbol)
  951. {
  952.  
  953.     if (action == MenuAction_End)
  954.     {
  955.         CloseHandle(BagCallback);
  956.         return;
  957.     }
  958.  
  959.     switch(symbol)
  960.     {
  961.         case 0:
  962.         {
  963.             DisplayEveryOneTransferint(client);
  964.         }
  965.         case 1:
  966.         {
  967.             if(iEveryOneMedkit > 0)
  968.             {
  969.                 iEveryOneMedkit--;
  970.                 GiveFunction(client, "first_aid_kit");
  971.                 Client_PrintToChatAll(true, "%t", "EveryOneTakenMedkit", client);
  972.             }
  973.         }
  974.         case 2:
  975.         {
  976.             if(iEveryOnePills > 0)
  977.             {
  978.                 iEveryOnePills--;
  979.                 GiveFunction(client, "pills");
  980.                 Client_PrintToChatAll(true, "%t", "EveryOneTakenPills", client);
  981.             }
  982.             else
  983.             {
  984.                 Client_PrintToChat(client, true, "%t", "EvetyOneBagNotPills");
  985.             }
  986.         }
  987.         case 3:
  988.         {
  989.             if(iEveryOneAdrenalins > 0)
  990.             {
  991.                 iEveryOneAdrenalins--;
  992.                 GiveFunction(client, "adrenaline");
  993.                 Client_PrintToChatAll(true, "%t", "EveryOneTakenAdrenaline", client);
  994.             }
  995.             else
  996.             {
  997.                 Client_PrintToChat(client, true, "%t", "EvetyOneBagNotAdrenalins");
  998.             }
  999.         }
  1000.         case 4:
  1001.         {
  1002.             if(iEveryOneDeffibrilator > 0)
  1003.             {
  1004.                 iEveryOneDeffibrilator--;
  1005.                 GiveFunction(client, "defibrillator");
  1006.                 Client_PrintToChatAll(true, "%t", "EveryOneTakenDefibs", client);
  1007.             }
  1008.             else
  1009.             {
  1010.                 Client_PrintToChat(client, true, "%t", "EvetyOneBagNotDefibs");
  1011.             }
  1012.         }
  1013.         case 5:
  1014.         {
  1015.             if(iEveryOneGnome > 0)
  1016.             {
  1017.                 iEveryOneGnome--;
  1018.                 GiveFunction(client, "gnome");
  1019.                 Client_PrintToChatAll(true, "%t", "EveryOneTakenGnome", client);
  1020.             }
  1021.             else
  1022.             {
  1023.                 Client_PrintToChat(client, true, "%t", "EvetyOneBagNotGnome");
  1024.             }
  1025.         }
  1026.     }
  1027.     if(action == MenuAction_Cancel)
  1028.     {
  1029.         if(symbol == MenuCancel_ExitBack)
  1030.         {
  1031.             DisplayMainMenu(client);
  1032.         }
  1033.     }
  1034. }
  1035.  
  1036. void DisplayBag(int client)
  1037. {
  1038.     Handle MainMenuDisplay = CreateMenu(MyBagMenu);
  1039.     //char sTitle[56];
  1040.     SetMenuTitle(MainMenuDisplay, "%t", "MyBagTitle");
  1041.  
  1042.     char sStringEx[128];
  1043.     Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
  1044.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1045.  
  1046.     Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
  1047.     AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1048.  
  1049.     Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
  1050.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1051.  
  1052.     Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
  1053.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1054.  
  1055.     Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
  1056.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1057.  
  1058.     SetMenuExitBackButton(MainMenuDisplay, true);
  1059.     SetMenuExitButton(MainMenuDisplay, true);
  1060.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1061. }
  1062.  
  1063. void DisplayCraftMenu(int client)
  1064. {
  1065.     Handle MainMenuDisplay = CreateMenu(Minecraft);
  1066.     //char sTitle[56];
  1067.     SetMenuTitle(MainMenuDisplay, "%t", "CraftMenuTitle");
  1068.  
  1069.     char sStringEx[128];
  1070.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftMedkit", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit));
  1071.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1072.  
  1073.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftPills", iCountPills[client], GetConVarInt(NeedToCraftPills));
  1074.     AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1075.  
  1076.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftAdrenaline", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline));
  1077.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1078.  
  1079.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftDefib", iCountDebifs[client], GetConVarInt(NeedToCraftDefib));
  1080.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1081.  
  1082.     Format(sStringEx, sizeof(sStringEx), "%t", "CraftGnome", iCountGnomes[client], GetConVarInt(NeedToCraftGnome));
  1083.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1084.  
  1085.     SetMenuExitBackButton(MainMenuDisplay, true);
  1086.     SetMenuExitButton(MainMenuDisplay, true);
  1087.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1088. }
  1089.  
  1090. public int Minecraft(Handle MinecraftCallback, MenuAction action, int client, int symbol)
  1091. {
  1092.  
  1093.     if (action == MenuAction_End)
  1094.     {
  1095.         CloseHandle(MinecraftCallback);
  1096.         return;
  1097.     }
  1098.  
  1099.     if(bIsSurvivor(client))
  1100.     {
  1101.         char iItem[32];
  1102.         GetMenuItem(MinecraftCallback, symbol, iItem, sizeof(iItem));
  1103.         symbol = StringToInt(iItem);
  1104.  
  1105.         switch(symbol)
  1106.         {
  1107.             case 0:
  1108.             {
  1109.                 if (iCountMedkits[client] >= GetConVarInt(NeedToCraftMedkit))
  1110.                 {
  1111.                     iCountMedkits[client] -= GetConVarInt(NeedToCraftMedkit);
  1112.                     iCraftedMedkits[client]++;
  1113.                     Client_PrintToChat(client, true, "%t", "YouCraftedMedkit");
  1114.                 }
  1115.                 else
  1116.                 {
  1117.                     Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfMedkits", GetConVarInt(NeedToCraftMedkit) - iCountMedkits[client]);
  1118.                 }
  1119.             }
  1120.             case 1:
  1121.             {
  1122.                 if(iCountPills[client] >= GetConVarInt(NeedToCraftPills))
  1123.                 {
  1124.                     iCountPills[client] -= GetConVarInt(NeedToCraftPills);
  1125.                     iCraftedPills[client]++;
  1126.                     Client_PrintToChat(client, true, "%t", "YouCraftedPills");
  1127.                 }
  1128.                 else
  1129.                 {
  1130.                     Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfPills", GetConVarInt(NeedToCraftPills) - iCountPills[client]);
  1131.                 }
  1132.             }
  1133.             case 2:
  1134.             {
  1135.                 if(iCountAdrenalins[client] >= GetConVarInt(NeedToCraftAdrenaline))
  1136.                 {
  1137.                     iCountAdrenalins[client] -= GetConVarInt(NeedToCraftAdrenaline);
  1138.                     iCraftedAdrenalins[client]++;
  1139.                     Client_PrintToChat(client, true, "%t", "YouCraftedAdrenaline");
  1140.                 }
  1141.                 else
  1142.                 {
  1143.                     Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfAdrenaline", GetConVarInt(NeedToCraftAdrenaline) - iCountAdrenalins[client]);
  1144.                 }
  1145.             }
  1146.             case 3:
  1147.             {
  1148.                 if(iCountDebifs[client] >= GetConVarInt(NeedToCraftDefib))
  1149.                 {
  1150.                     iCountDebifs[client] -= GetConVarInt(NeedToCraftDefib);
  1151.                     iCraftedDebifs[client]++;
  1152.                     Client_PrintToChat(client, true, "%t", "YouCraftedDefib");
  1153.                 }
  1154.                 else
  1155.                 {
  1156.                     Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfDefib", GetConVarInt(NeedToCraftDefib) - iCountDebifs[client]);
  1157.                 }
  1158.             }
  1159.             case 4:
  1160.             {
  1161.                 if(iCountGnomes[client] >= GetConVarInt(NeedToCraftGnome))
  1162.                 {
  1163.                     iCountAdrenalins[client] -= GetConVarInt(NeedToCraftGnome);
  1164.                     iCraftedGnomes[client]++;
  1165.                     Client_PrintToChat(client, true, "%t", "YouCraftedGnome");
  1166.                 }
  1167.                 else
  1168.                 {
  1169.                     Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfGnome", GetConVarInt(NeedToCraftAdrenaline) - iCountGnomes[client]);
  1170.                 }
  1171.             }
  1172.         }
  1173.     }
  1174.     if(action == MenuAction_Cancel)
  1175.     {
  1176.         if(symbol == MenuCancel_ExitBack)
  1177.         {
  1178.             DisplayMainMenu(client);
  1179.         }
  1180.     }
  1181. }
  1182.  
  1183. void DisplayMainMenu(int client)
  1184. {
  1185.     Handle MainMenuDisplay = CreateMenu(MainBox);
  1186.     //char sTitle[56];
  1187.     SetMenuTitle(MainMenuDisplay, "%t", "MainMenuTitle");
  1188.  
  1189.     char sStringEx[128];
  1190.     Format(sStringEx, sizeof(sStringEx), "%t", "Stats");
  1191.     AddMenuItem(MainMenuDisplay, "0", sStringEx);
  1192.  
  1193.     if(!Fast_Reload && !IsHelpHand && !Anti_Damage && !Speed_Up && !MeleeDamage)
  1194.     {
  1195.         Format(sStringEx, sizeof(sStringEx), "%t", "Passive Perks");
  1196.         AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
  1197.     }
  1198.     else
  1199.     {
  1200.         Format(sStringEx, sizeof(sStringEx), "%t", "Passive Perks");
  1201.         AddMenuItem(MainMenuDisplay, "1", sStringEx);
  1202.     }
  1203.     Format(sStringEx, sizeof(sStringEx), "%t", "Perks");
  1204.     AddMenuItem(MainMenuDisplay, "2", sStringEx);
  1205.  
  1206.     Format(sStringEx, sizeof(sStringEx), "%t", "TrasferOfMoney");
  1207.     AddMenuItem(MainMenuDisplay, "3", sStringEx);
  1208.  
  1209.     Format(sStringEx, sizeof(sStringEx), "%t", "TransferToTeamBank");
  1210.     AddMenuItem(MainMenuDisplay, "4", sStringEx);
  1211.  
  1212.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamImprovements");
  1213.     AddMenuItem(MainMenuDisplay, "5", sStringEx);
  1214.  
  1215.     Format(sStringEx, sizeof(sStringEx), "%t", "ShopMainMenu");
  1216.     AddMenuItem(MainMenuDisplay, "6", sStringEx);
  1217.  
  1218.     if(Crafting)
  1219.     {
  1220.         if(GetStatePerk(client, Index_Crafting))
  1221.         {
  1222.             Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu");
  1223.             AddMenuItem(MainMenuDisplay, "7", sStringEx);
  1224.         }
  1225.         else
  1226.         {
  1227.             Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu");
  1228.             AddMenuItem(MainMenuDisplay, "7", sStringEx, ITEMDRAW_DISABLED);
  1229.         }
  1230.  
  1231.         Format(sStringEx, sizeof(sStringEx), "%t", "InventoryMainMenu");
  1232.         AddMenuItem(MainMenuDisplay, "8", sStringEx);
  1233.  
  1234.         Format(sStringEx, sizeof(sStringEx), "%t", "BagMainMenu");
  1235.         AddMenuItem(MainMenuDisplay, "9", sStringEx);
  1236.  
  1237.         Format(sStringEx, sizeof(sStringEx), "%t", "EveryOneBagMenu");
  1238.         AddMenuItem(MainMenuDisplay, "10", sStringEx);
  1239.     }
  1240.     SetMenuExitButton(MainMenuDisplay, true);
  1241.     DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
  1242. }
  1243.  
  1244. void DisplayPerksPassiveMenu(int client)
  1245. {
  1246.     Handle MainPassivePerks = CreateMenu(MainPerksPassiveMenu);
  1247.     SetMenuTitle(MainPassivePerks, "%t", "TitleMenuPassivePerks");
  1248.     char sStringEx[128];
  1249.     if(IsHelpHand)
  1250.     {
  1251.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkHelpingHand", GetConVarInt(CostHelpingHand));
  1252.         if(g_GlobalEnabledBool[client][Index_HelpingHand])
  1253.         {
  1254.             AddMenuItem(MainPassivePerks, "4", sStringEx, ITEMDRAW_DISABLED);
  1255.         }
  1256.         else
  1257.         {
  1258.             AddMenuItem(MainPassivePerks, "4", sStringEx);
  1259.         }
  1260.     }
  1261.  
  1262.     if(Speed_Up)
  1263.     {
  1264.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkSpeedUp", GetConVarInt(CostSpeedUp));
  1265.         if(g_GlobalEnabledBool[client][Index_SpeedUp])
  1266.         {
  1267.             AddMenuItem(MainPassivePerks, "8", sStringEx, ITEMDRAW_DISABLED);
  1268.         }
  1269.         else
  1270.         {
  1271.             AddMenuItem(MainPassivePerks, "8", sStringEx);
  1272.         }
  1273.     }
  1274.  
  1275.     if(Double_Jump)
  1276.     {
  1277.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkDoubleJump", GetConVarInt(CostDoubleJump));
  1278.         if(g_GlobalEnabledBool[client][Index_DoubleJump])
  1279.         {
  1280.             AddMenuItem(MainPassivePerks, "10", sStringEx, ITEMDRAW_DISABLED);
  1281.         }
  1282.         else
  1283.         {
  1284.             AddMenuItem(MainPassivePerks, "10", sStringEx);
  1285.         }
  1286.     }
  1287.  
  1288.     if(Anti_Damage)
  1289.     {
  1290.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkAntiDamage", GetConVarInt(CostAntiDamage));
  1291.         if(g_GlobalEnabledBool[client][Index_AntiDamage])
  1292.         {
  1293.             AddMenuItem(MainPassivePerks, "1", sStringEx, ITEMDRAW_DISABLED);
  1294.         }
  1295.         else
  1296.         {
  1297.             AddMenuItem(MainPassivePerks, "1", sStringEx);
  1298.         }
  1299.     }
  1300.  
  1301.     if(MeleeDamage)
  1302.     {
  1303.         Format(sStringEx, sizeof(sStringEx), "%t", "MeleeDamage", GetConVarInt(CostMeleeDamage));
  1304.         if(g_GlobalEnabledBool[client][Index_MeleeDamage])
  1305.         {
  1306.             AddMenuItem(MainPassivePerks, "5", sStringEx, ITEMDRAW_DISABLED);
  1307.         }
  1308.         else
  1309.         {
  1310.             AddMenuItem(MainPassivePerks, "5", sStringEx);
  1311.         }
  1312.     }
  1313.  
  1314.     if(Fast_Reload)
  1315.     {
  1316.         Format(sStringEx, sizeof(sStringEx), "%t", "FastRealodPerk", GetConVarInt(CostFastReload));
  1317.         if(g_GlobalEnabledBool[client][Index_FastReload])
  1318.         {
  1319.             AddMenuItem(MainPassivePerks, "3", sStringEx, ITEMDRAW_DISABLED);
  1320.         }
  1321.         else
  1322.         {
  1323.             AddMenuItem(MainPassivePerks, "3", sStringEx);
  1324.         }
  1325.     }
  1326.     SetMenuExitBackButton(MainPassivePerks, true);
  1327.     SetMenuExitButton(MainPassivePerks, true);
  1328.     DisplayMenu(MainPassivePerks, client, MENU_TIME_FOREVER);
  1329. }
  1330.  
  1331. public int MainPerksPassiveMenu(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
  1332. {
  1333.     if(action == MenuAction_Cancel )
  1334.     {
  1335.         if(symbol == MenuCancel_ExitBack)
  1336.             DisplayMainMenu(client);
  1337.     }
  1338.     else if( action == MenuAction_Select )
  1339.     {
  1340.         char iItem[32];
  1341.         GetMenuItem(TeamUpgradeMenu, symbol, iItem, sizeof(iItem));
  1342.         symbol = StringToInt(iItem);
  1343.  
  1344.         if(bIsSurvivor(client))
  1345.         {
  1346.             if(Cash[client] >= g_iArrayCostList[symbol])
  1347.             {
  1348.                 PrintToChatAll("%i", symbol);
  1349.                 DisplayMainMenu(client);
  1350.                 Cash[client] -= g_iArrayCostList[symbol];
  1351.                 //SendGlobalForward(client, symbol, true);
  1352.                 g_GlobalEnabledBool[client][symbol] = true;
  1353.                 Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[symbol]);
  1354.             }
  1355.         }
  1356.     }
  1357. }
  1358.  
  1359. /*
  1360. void SendGlobalForward(int client, int type, bool status)
  1361. {
  1362.     Call_StartForward(g_hGlobalForwardRequest);
  1363.     Call_PushCell(client);
  1364.     Call_PushCell(type);
  1365.     Call_PushCell(status);
  1366.     Call_Finish();
  1367. }
  1368. */
  1369. void ShowPerksPanelUpgradePipe(int client)
  1370. {
  1371.     Handle PerksUpgrade = CreatePanel();
  1372.     if(vLvLPipes[client] < vMaxLvLPipes)
  1373.     {
  1374.         char sStringEx[128];
  1375.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkNameOfUpgradePipeBomb");
  1376.  
  1377.         char sPanelEx[32];
  1378.         Format(sPanelEx, sizeof(sPanelEx), "%t", "TitleOfUpgradePipeBomb");
  1379.         SetPanelTitle(PerksUpgrade, sPanelEx);
  1380.  
  1381.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  1382.  
  1383.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomblvl", vLvLPipes[client]);
  1384.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  1385.  
  1386.         Format(sStringEx, sizeof(sStringEx), "%t", "CostOfUpgradePipeBomb", GetConVarInt(CostUpgradePipe));
  1387.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  1388.  
  1389.         Format(sStringEx, sizeof(sStringEx), "%t", "CountOfPipesOfPerkPipeBomb", vLvLPipes[client]);
  1390.         DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
  1391.  
  1392.         DrawPanelItem(PerksUpgrade, "Прокачать");
  1393.         DrawPanelItem(PerksUpgrade, "Выйти");
  1394.         SendPanelToClient(PerksUpgrade, client, PerksUpgradeCallback, 0);
  1395.         CloseHandle(PerksUpgrade);
  1396.     }
  1397.     else
  1398.     {
  1399.         Client_PrintToChat(client, true, "{R}Вы {L}достигли макс. уровня перка(Пайпо Мёт)");
  1400.     }
  1401. }
  1402.  
  1403. public int PerksUpgradeCallback(Handle panel, MenuAction action, int client, int symbol)
  1404. {
  1405.     if (action == MenuAction_End)
  1406.     {
  1407.         CloseHandle(panel);
  1408.         return;
  1409.     }
  1410.  
  1411.     if( action == MenuAction_Select )
  1412.     {
  1413.         switch(symbol)
  1414.         {
  1415.             case 5:
  1416.             {
  1417.                 if(Cash[client] >= GetConVarInt(CostUpgradePipe))
  1418.                 {
  1419.                     Cash[client] -= GetConVarInt(CostUpgradePipe);
  1420.                     vLvLPipes[client]++;
  1421.                     Client_PrintToChat(client, true, "%t", "YouHasBeenUpgradedPipeBomb");
  1422.                     Client_PrintToChat(client, true, "%t", "CountOfPipesPerk", vLvLPipes[client]);
  1423.                     DisplayMainMenu(client);
  1424.                 }
  1425.             }
  1426.         }
  1427.     }
  1428.     else if(action == MenuAction_Cancel)
  1429.     {
  1430.         if(symbol == MenuCancel_ExitBack)
  1431.         {
  1432.             DisplayPerksMenu(client);
  1433.         }
  1434.     }
  1435. }
  1436.  
  1437. void DisplayPerksMenu(int client)
  1438. {
  1439.     Handle MainPerks = CreateMenu(MainPerksMenu);
  1440.     char sStringEx[128];
  1441.     Format(sStringEx, sizeof(sStringEx), "%t", "TitleNameOfMenuPerks");
  1442.     SetMenuTitle(MainPerks, sStringEx);
  1443.  
  1444.     if(Ultra_Pipe_Bomb)
  1445.     {
  1446.         Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBombUpgrade++", GetConVarInt(CostUpgradePipe));
  1447.         if(g_GlobalEnabledBool[client][Index_PipeBomBUltra])
  1448.         {
  1449.             AddMenuItem(MainPerks, "9", sStringEx);
  1450.         }
  1451.         else
  1452.         {
  1453.             Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomb", GetConVarInt(CostUltraPipe));
  1454.             AddMenuItem(MainPerks, "9", sStringEx);
  1455.         }
  1456.     }
  1457.     if(Pipa_Velcro)
  1458.     {
  1459.         if(!g_GlobalEnabledBool[client][Index_StickyPipe])
  1460.         {
  1461.             Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
  1462.             AddMenuItem(MainPerks, "7", sStringEx);
  1463.         }
  1464.         else
  1465.         {
  1466.             Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
  1467.             AddMenuItem(MainPerks, "7", sStringEx, ITEMDRAW_DISABLED);
  1468.         }
  1469.     }
  1470.     if(Perfect_Shove)
  1471.     {
  1472.         if(!g_GlobalEnabledBool[client][Index_PerfectShove])
  1473.         {
  1474.             Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
  1475.             AddMenuItem(MainPerks, "6", sStringEx);
  1476.         }
  1477.         else
  1478.         {
  1479.             Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
  1480.             AddMenuItem(MainPerks, "6", sStringEx, ITEMDRAW_DISABLED);
  1481.         }
  1482.     }
  1483.     if(Crafting)
  1484.     {
  1485.         if(!g_GlobalEnabledBool[client][Index_Crafting])
  1486.         {
  1487.             Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
  1488.             AddMenuItem(MainPerks, "11", sStringEx);
  1489.         }
  1490.         else
  1491.         {
  1492.             Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
  1493.             AddMenuItem(MainPerks, "11", sStringEx, ITEMDRAW_DISABLED);
  1494.         }
  1495.     }
  1496.     if(Epic_Molotov)
  1497.     {
  1498.         if(!g_GlobalEnabledBool[client][Index_Molotov])
  1499.         {
  1500.             Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov", GetConVarInt(CostEpicMoli));
  1501.             AddMenuItem(MainPerks, "2", sStringEx);
  1502.         }
  1503.         else
  1504.         {
  1505.             Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov++", GetConVarInt(CostEpicMoliUpgrade));
  1506.             AddMenuItem(MainPerks, "2", sStringEx);
  1507.         }
  1508.     }
  1509.     SetMenuExitBackButton(MainPerks, true);
  1510.     SetMenuExitButton(MainPerks, true);
  1511.     DisplayMenu(MainPerks, client, MENU_TIME_FOREVER);
  1512. }
  1513.  
  1514. public int MainPerksMenu(Handle TransferMenu, MenuAction action, int client, int symbol)
  1515. {
  1516.     if (action == MenuAction_End)
  1517.     {
  1518.         CloseHandle(TransferMenu);
  1519.         return 0;
  1520.     }
  1521.  
  1522.     if(action == MenuAction_Select)
  1523.     {
  1524.         char iItem[32];
  1525.         GetMenuItem(TransferMenu, symbol, iItem, sizeof(iItem));
  1526.         symbol = StringToInt(iItem);
  1527.         switch(symbol)
  1528.         {
  1529.             case 9:
  1530.             {
  1531.                 if(!g_GlobalEnabledBool[client][Index_PipeBomBUltra])
  1532.                 {
  1533.                     if(Cash[client] >= g_iArrayCostList[Index_PipeBomBUltra])
  1534.                     {
  1535.                         Cash[client] -= g_iArrayCostList[Index_PipeBomBUltra];
  1536.                         g_GlobalEnabledBool[client][Index_PipeBomBUltra] = true;
  1537.                         //SendGlobalForward(client, Index_PipeBomBUltra, true);
  1538.                         Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[Index_PipeBomBUltra]);
  1539.                         DisplayMainMenu(client);
  1540.                     }
  1541.                 }
  1542.                 else
  1543.                 {
  1544.                     ShowPerksPanelUpgradePipe(client);
  1545.                 }
  1546.             }
  1547.             case 2:
  1548.             {
  1549.                 if(!g_GlobalEnabledBool[client][Index_Molotov])
  1550.                 {
  1551.                     if(Cash[client] >= g_iArrayCostList[Index_Molotov])
  1552.                     {
  1553.                         Cash[client] -= g_iArrayCostList[Index_Molotov];
  1554.                         g_GlobalEnabledBool[client][symbol] = true;
  1555.                         //SendGlobalForward(client, Index_StickyPipe, true);
  1556.                         Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[Index_Molotov]);
  1557.                         DisplayMainMenu(client);
  1558.                     }
  1559.                 }
  1560.                 else
  1561.                 {
  1562.                     DisplayUpgradeMolotov(client);
  1563.                 }
  1564.             }
  1565.             default:
  1566.             {
  1567.                 if(Cash[client] < g_iArrayCostList[symbol]) return 0;
  1568.  
  1569.                 Cash[client] -= g_iArrayCostList[symbol];
  1570.                 //SendGlobalForward(client, symbol, true);
  1571.                 g_GlobalEnabledBool[client][symbol] = true;
  1572.                 Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[symbol]);
  1573.                 DisplayMainMenu(client);
  1574.             }
  1575.         }
  1576.     }
  1577.     else if(action == MenuAction_Cancel)
  1578.     {
  1579.         if(symbol == MenuCancel_ExitBack)
  1580.         {
  1581.             DisplayMainMenu(client);
  1582.         }
  1583.     }
  1584.     return 0;
  1585. }
  1586.  
  1587. void DisplayUpgradeMolotov(int client)
  1588. {
  1589.     Handle MolikUp = CreateMenu(UpgradeMoloCall);
  1590.  
  1591.     int iLevel = iCountOfMoliks[client];
  1592.     int iLevelM = iCountOfMoliks[client] + 1;
  1593.     //char sTitle[56];
  1594.     SetMenuTitle(MolikUp, "%t", "UpgradeMolotovTitle");
  1595.  
  1596.     char sStringEx[128];
  1597.     Format(sStringEx, sizeof(sStringEx), "%t", "NameOfPerkMolotov");
  1598.     AddMenuItem(MolikUp, "0", sStringEx, ITEMDRAW_DISABLED);
  1599.  
  1600.     Format(sStringEx, sizeof(sStringEx), "%t", "CostUpgradeMolotov", GetConVarInt(CostEpicMoliUpgrade));
  1601.     AddMenuItem(MolikUp, "1", sStringEx, ITEMDRAW_DISABLED);
  1602.  
  1603.     Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovs", iLevel, iMaxLevelMolo);
  1604.     AddMenuItem(MolikUp, "2", sStringEx, ITEMDRAW_DISABLED);
  1605.  
  1606.     Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovsOnNextLevel", iLevelM);
  1607.     AddMenuItem(MolikUp, "3", sStringEx, ITEMDRAW_DISABLED);
  1608.  
  1609.     Format(sStringEx, sizeof(sStringEx), "%t", "LevelOfPerk", iLevel);
  1610.     AddMenuItem(MolikUp, "4", sStringEx, ITEMDRAW_DISABLED);
  1611.  
  1612.     Format(sStringEx, sizeof(sStringEx), "%t", "UpgradeMolikButton");
  1613.     AddMenuItem(MolikUp, "5", sStringEx);
  1614.  
  1615.     SetMenuExitBackButton(MolikUp, true);
  1616.     SetMenuExitButton(MolikUp, true);
  1617.     DisplayMenu(MolikUp, client, MENU_TIME_FOREVER);
  1618. }
  1619.  
  1620. public int UpgradeMoloCall(Handle Shop, MenuAction action, int client, int symbol)
  1621. {
  1622.     if (action == MenuAction_End)
  1623.     {
  1624.         CloseHandle(Shop);
  1625.         return;
  1626.     }
  1627.  
  1628.     if( action == MenuAction_Select )
  1629.     {
  1630.         switch(symbol)
  1631.         {
  1632.             case 5:
  1633.             {
  1634.                 if(iCountOfMoliks[client] < iMaxLevelMolo)
  1635.                 {
  1636.                     if(Cash[client] >= GetConVarInt(CostEpicMoliUpgrade))
  1637.                     {
  1638.                         Cash[client] -= GetConVarInt(CostEpicMoliUpgrade);
  1639.                         iCountOfMoliks[client]++;
  1640.                         Client_PrintToChat(client, true, "%t", "YouUpgradedMolotov", iCountOfMoliks[client], iMaxLevelMolo);
  1641.                         Client_PrintToChat(client, true, "%t", "CountOfMolotovUpgraded", iCountOfMoliks[client]);
  1642.                         DisplayMainMenu(client);
  1643.                     }
  1644.                 }
  1645.                 else
  1646.                 {
  1647.                     Client_PrintToChat(client, true, "%t", "MaxLevelOfMolotov");
  1648.                     DisplayMainMenu(client);
  1649.                 }
  1650.             }
  1651.         }
  1652.     }
  1653.     else if(action == MenuAction_Cancel)
  1654.     {
  1655.         if(symbol == MenuCancel_ExitBack)
  1656.         {
  1657.             DisplayMainMenu(client);
  1658.         }
  1659.     }
  1660. }
  1661.  
  1662. void DisplayStatisticMenu(int client)
  1663. {
  1664.     Handle MainStats = CreateMenu(MainStatsMenu);
  1665.     char sItemEx[56];
  1666.     Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuStatistic");
  1667.     SetMenuTitle(MainStats, sItemEx);
  1668.  
  1669.     Format(sItemEx, sizeof(sItemEx), "%t", "YourMoney", Cash[client]);
  1670.     AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
  1671.  
  1672.     Format(sItemEx, sizeof(sItemEx), "%t", "TeamCash", TeamCash);
  1673.     AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
  1674.  
  1675.     AddMenuItem(MainStats, "777", "Soon...", ITEMDRAW_DISABLED);
  1676.  
  1677.     SetMenuExitBackButton(MainStats, true);
  1678.     SetMenuExitButton(MainStats, true);
  1679.     DisplayMenu(MainStats, client, MENU_TIME_FOREVER);
  1680. }
  1681.  
  1682. public int MainStatsMenu(Handle menu, MenuAction action, int client, int symbol)
  1683. {
  1684.     if(action == MenuAction_Cancel)
  1685.     {
  1686.         if(symbol == MenuCancel_ExitBack)
  1687.         {
  1688.             DisplayMainMenu(client);
  1689.         }
  1690.     }
  1691. }
  1692.  
  1693. void DisplayBankTo(int client)
  1694. {
  1695.     Handle BankTo = CreateMenu(MenuBankTransfer);
  1696.     SetMenuTitle(BankTo, "Ваш вклад:");
  1697.     AddMenuItem(BankTo, "0", "10%");
  1698.     AddMenuItem(BankTo, "1", "20%");
  1699.     AddMenuItem(BankTo, "2", "30%");
  1700.     AddMenuItem(BankTo, "3", "40%");
  1701.     AddMenuItem(BankTo, "4", "50%");
  1702.     AddMenuItem(BankTo, "5", "60%");
  1703.     AddMenuItem(BankTo, "6", "70%");
  1704.     AddMenuItem(BankTo, "7", "80%");
  1705.     AddMenuItem(BankTo, "8", "90%");
  1706.     AddMenuItem(BankTo, "9", "100%");
  1707.  
  1708.     SetMenuExitBackButton(BankTo, true);
  1709.     SetMenuExitButton(BankTo, true);
  1710.     DisplayMenu(BankTo, client, MENU_TIME_FOREVER);
  1711. }
  1712.  
  1713. void DisplayShop(int client)
  1714. {
  1715.     Handle Shop = CreateMenu(MenuShop);
  1716.     char sItemEx[96];
  1717.     Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuShop");
  1718.     SetMenuTitle(Shop, sItemEx);
  1719.  
  1720.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmo", GetConVarInt(CostExpAmmo));
  1721.     AddMenuItem(Shop, "0", sItemEx);
  1722.  
  1723.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmo", GetConVarInt(CostIncAmmo));
  1724.     AddMenuItem(Shop, "1", sItemEx);
  1725.  
  1726.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopLaserSight", GetConVarInt(CostLaserSight));
  1727.     AddMenuItem(Shop, "2", sItemEx);
  1728.  
  1729.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmoPack", GetConVarInt(CostExpAmmoPack));
  1730.     AddMenuItem(Shop, "3", sItemEx);
  1731.  
  1732.     Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmoPack", GetConVarInt(CostIncAmmoPack));
  1733.     AddMenuItem(Shop, "4", sItemEx);
  1734.  
  1735.     SetMenuExitBackButton(Shop, true);
  1736.     SetMenuExitButton(Shop, true);
  1737.     DisplayMenu(Shop, client, MENU_TIME_FOREVER);
  1738. }
  1739.  
  1740. public int MenuShop(Handle Shop, MenuAction action, int client, int symbol)
  1741. {
  1742.     if (action == MenuAction_End)
  1743.     {
  1744.         CloseHandle(Shop);
  1745.         return;
  1746.     }
  1747.  
  1748.     switch(symbol)
  1749.     {
  1750.         case 0:
  1751.         {
  1752.             if(Cash[client] >= GetConVarInt(CostExpAmmo))
  1753.             {
  1754.                 Cash[client] -= GetConVarInt(CostExpAmmo);
  1755.                 GiveUpgrade(client, 1);
  1756.                 Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
  1757.             }
  1758.         }
  1759.         case 1:
  1760.         {
  1761.             if(Cash[client] >= GetConVarInt(CostIncAmmo))
  1762.             {
  1763.                 Cash[client] -= GetConVarInt(CostIncAmmo);
  1764.                 GiveUpgrade(client, 2);
  1765.                 Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
  1766.             }
  1767.         }
  1768.         case 2:
  1769.         {
  1770.             if(Cash[client] >= GetConVarInt(CostLaserSight))
  1771.             {
  1772.                 Cash[client] -= GetConVarInt(CostLaserSight);
  1773.                 GiveUpgrade(client, 3);
  1774.                 Client_PrintToChat(client, true, "%t", "BoughtLaserSight");
  1775.             }
  1776.         }
  1777.         case 3:
  1778.         {
  1779.             if(Cash[client] >= GetConVarInt(CostExpAmmoPack))
  1780.             {
  1781.                 Cash[client] -= GetConVarInt(CostExpAmmoPack);
  1782.                 GiveFunction(client, "upgradepack_explosive");
  1783.                 Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
  1784.             }
  1785.         }
  1786.         case 4:
  1787.         {
  1788.             if(Cash[client] >= GetConVarInt(CostIncAmmoPack))
  1789.             {
  1790.                 Cash[client] -= GetConVarInt(CostIncAmmoPack);
  1791.                 GiveFunction(client, "upgradepack_incendiary");
  1792.                 Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
  1793.             }
  1794.         }
  1795.     }
  1796.     if(action == MenuAction_Cancel)
  1797.     {
  1798.         if(symbol == MenuCancel_ExitBack)
  1799.         {
  1800.             DisplayMainMenu(client);
  1801.         }
  1802.     }
  1803. }
  1804.  
  1805. public int MenuBankTransfer(Handle TransferMenu, MenuAction action, int client, int symbol)
  1806. {
  1807.     if (action == MenuAction_End)
  1808.     {
  1809.         CloseHandle(TransferMenu);
  1810.         return;
  1811.     }
  1812.  
  1813.     int TrasferCash = Cash[client];
  1814.     int NumCash = 0;
  1815.     int Procents = 0;
  1816.     if(bIsSurvivor(client))
  1817.     {
  1818.         symbol += 1;
  1819.         NumCash = RoundToCeil(TrasferCash * (0.1 * symbol));
  1820.         Cash[client] -= NumCash;
  1821.         TeamCash += NumCash;
  1822.         Procents = 10 * (symbol + 1);
  1823.         Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
  1824.     }
  1825.     if(action == MenuAction_Cancel)
  1826.     {
  1827.         if(symbol == MenuCancel_ExitBack)
  1828.         {
  1829.             DisplayMainMenu(client);
  1830.         }
  1831.     }
  1832. }
  1833.  
  1834. void DisplayTeamHelp(int client)
  1835. {
  1836.     Handle TeamUp = CreateMenu(MenuTeamUpgrade);
  1837.     char sStringEx[64];
  1838.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradesTitle");
  1839.  
  1840.     SetMenuTitle(TeamUp, sStringEx);
  1841.     if(vHealUpTeam == null)
  1842.     {
  1843.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
  1844.         AddMenuItem(TeamUp, "0", sStringEx);
  1845.     }
  1846.     else
  1847.     {
  1848.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
  1849.         AddMenuItem(TeamUp, "0", sStringEx, ITEMDRAW_DISABLED);
  1850.     }
  1851.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeKillAllCommons");
  1852.     AddMenuItem(TeamUp, "1", sStringEx);
  1853.     if(vPoisonTeam != null)
  1854.     {
  1855.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
  1856.         AddMenuItem(TeamUp, "2", sStringEx, ITEMDRAW_DISABLED);
  1857.     }
  1858.     else
  1859.     {
  1860.         Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
  1861.         AddMenuItem(TeamUp, "2", sStringEx);
  1862.     }
  1863.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeIgniteAssForAllSpecials");
  1864.     AddMenuItem(TeamUp, "3", sStringEx);
  1865.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeHealAllSurvivorFor50Hp");
  1866.     AddMenuItem(TeamUp, "4", sStringEx);
  1867.     Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeBuyAmmoForAllSurvivors");
  1868.     AddMenuItem(TeamUp, "5", sStringEx);
  1869.     SetMenuExitBackButton(TeamUp, true);
  1870.     SetMenuExitButton(TeamUp, true);
  1871.     DisplayMenu(TeamUp, client, MENU_TIME_FOREVER);
  1872. }
  1873.  
  1874. public int MenuTeamUpgrade(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
  1875. {
  1876.     if (action == MenuAction_End)
  1877.     {
  1878.         CloseHandle(TeamUpgradeMenu);
  1879.         return;
  1880.     }
  1881.  
  1882.     if(bIsSurvivor(client))
  1883.     {
  1884.         switch(symbol)
  1885.         {
  1886.             case 0:
  1887.             {
  1888.                 if(TeamCash >= 50000)
  1889.                 {
  1890.                     vHealUpTeam = CreateTimer(2.0, vTeamHealUp, _, TIMER_REPEAT);
  1891.                     //TeamHeal = true;
  1892.                     TeamCash -= 50000;
  1893.                     for(int i = 1; i <= MaxClients; ++i)
  1894.                     {
  1895.                         if(client != i)
  1896.                         {
  1897.                             if(IsInGame(i))
  1898.                             {
  1899.                                 Client_PrintToChat(i, true, "%t", "ChatWhoBoughtRegeneration", client);
  1900.                                 //Client_PrintToChat(i, true, "{B}%N {R}купил регенерацию хп для выживших.", client);
  1901.                             }
  1902.                         }
  1903.                         else
  1904.                         {
  1905.                             if(IsInGame(i))
  1906.                             {
  1907.                                 Client_PrintToChat(i, true, "%t", "YouBuyRegeneration");
  1908.                                 //Client_PrintToChat(i, true, "{B}Вы {R}купили регенерацию хп.");
  1909.                             }
  1910.                         }
  1911.                     }
  1912.                 }
  1913.             }
  1914.             case 1:
  1915.             {
  1916.                 if(TeamCash >= 30000)
  1917.                 {
  1918.                     TeamCash -= 30000;
  1919.                     for(int i = 33; i <= 2048; ++i)
  1920.                     {
  1921.                         if(IsCommonInfected(i))
  1922.                         {
  1923.                             ForceDamageEntity(client, 1000, i);
  1924.                         }
  1925.                     }
  1926.                     for(int i = 1; i <= MaxClients; ++i)
  1927.                     {
  1928.                         if(client != i)
  1929.                         {
  1930.                             if(IsInGame(i))
  1931.                             {
  1932.                                 Client_PrintToChat(i, true, "%t", "WhoKilledAllCommonForTeamCash", client);
  1933.                                 //Client_PrintToChat(i, true, "{B}%N {R}убил всех мобов за командные очки.", client);
  1934.                             }
  1935.                         }
  1936.                         else
  1937.                         {
  1938.                             if(IsInGame(i))
  1939.                             {
  1940.                                 Client_PrintToChat(i, true, "%t", "YouKilledAllCommonsForTeamCash");
  1941.                             }
  1942.                         }
  1943.                     }
  1944.                 }
  1945.             }
  1946.             case 2:
  1947.             {
  1948.                 if(TeamCash >= 30000)
  1949.                 {
  1950.                     vPoisonTeam = CreateTimer(2.0, vTeamPoison, client, TIMER_REPEAT);
  1951.                     CreateTimer(30.0, vTeamPoisonKill);
  1952.                     TeamCash -= 30000;
  1953.                     for(int i = 1; i <= MaxClients; ++i)
  1954.                     {
  1955.                         if(client != i)
  1956.                         {
  1957.                             if(IsInGame(i))
  1958.                             {
  1959.                                 Client_PrintToChat(i, true, "%t.", "WhoPoisonedInf", client);
  1960.                                 //Client_PrintToChat(i, true, "{B}%N {R}отравил заражённых за командные очки.", client);
  1961.                             }
  1962.                         }
  1963.                         else
  1964.                         {
  1965.                             if(IsInGame(i))
  1966.                             {
  1967.                                 Client_PrintToChat(i, true, "%t.", "YouPoisonedInf", client);
  1968.                                 Client_PrintToChat(i, true, "{B}Вы {R}отравили заражённых.");
  1969.                             }
  1970.                         }
  1971.                     }
  1972.                 }
  1973.             }
  1974.             case 3:
  1975.             {
  1976.                 if(TeamCash >= 10000)
  1977.                 {
  1978.                     TeamCash -= 10000;
  1979.                     for(int i = 1; i <= MaxClients; ++i)
  1980.                     {
  1981.                         if(client != i)
  1982.                         {
  1983.                             if(IsInGame(i))
  1984.                             {
  1985.                                 Client_PrintToChat(i, true, "%t.", "WhoIgnitedTheHearts", client);
  1986.                                 //Client_PrintToChat(i, true, "{B}%N {R}поджог пукан заражённых.", client);
  1987.                             }
  1988.                         }
  1989.                         else
  1990.                         {
  1991.                             if(IsInGame(i))
  1992.                             {
  1993.                                 Client_PrintToChat(i, true, "%t.", "YouIgnitedTheHearts", client);
  1994.                                 Client_PrintToChat(i, true, "{B}Вы {R}воспламенили очаг.");
  1995.                             }
  1996.                         }
  1997.                         if(IsValidInfected(i))
  1998.                         {
  1999.                             float vPos[3];
  2000.                             GetClientAbsOrigin(i, vPos);
  2001.                             LittleFlower(vPos, 0);
  2002.                             LittleFlower(vPos, 1);
  2003.                         }
  2004.                     }
  2005.                 }
  2006.             }
  2007.             case 4:
  2008.             {
  2009.                 if(TeamCash >= 15000)
  2010.                 {
  2011.                     TeamCash -= 15000;
  2012.                     for(int i = 1; i <= MaxClients; ++i)
  2013.                     {
  2014.                         if(client != i)
  2015.                         {
  2016.                             if(IsInGame(i))
  2017.                             {
  2018.                                 Client_PrintToChat(i, true, "%t.", "WhoHealedSurvivors", client);
  2019.                                 //Client_PrintToChat(i, true, "{B}%N {R}вылечил всех на 50 хп за командные очки.", client);
  2020.                             }
  2021.                         }
  2022.                         else
  2023.                         {
  2024.                             if(IsInGame(i))
  2025.                             {
  2026.                                 Client_PrintToChat(i, true, "%t.", "YouHealedSurvivors");
  2027.                                 //Client_PrintToChat(i, true, "{B}Вы {R}полечили всех выживших.");
  2028.                             }
  2029.                         }
  2030.                         if(bIsSurvivor(i) && !IsPlayerIncaped(i))
  2031.                         {
  2032.                             int vHeal = GetClientHealth(i);
  2033.                             float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
  2034.  
  2035.                             if(vHeal + 50 + RoundToCeil(vHealthBuffer) > 100 || vHeal > 100 || vHealthBuffer > 100 || vHeal + vHealthBuffer > 100)
  2036.                             {
  2037.                                 SetEntityHealth(i, 100);
  2038.                                 SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
  2039.                             }
  2040.                             else if(RoundToCeil(vHeal + vHealthBuffer) < 100)
  2041.                             {
  2042.                                 float vForward = vHeal - vHealthBuffer;
  2043.                                 if(vForward < 0)
  2044.                                 {
  2045.                                     SetEntityHealth(i, vHeal + 50);
  2046.                                     SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
  2047.                                 }
  2048.                                 else
  2049.                                 {
  2050.                                     float vTransitPoint = 50 - vHealthBuffer;
  2051.                                     SetEntityHealth(i, RoundToCeil(vHeal + vTransitPoint));
  2052.                                     SetEntPropFloat(client, Prop_Send, "m_healthBuffer", vHealthBuffer - vTransitPoint);
  2053.                                 }
  2054.                             }
  2055.                         }
  2056.                     }
  2057.                 }
  2058.             }
  2059.             case 5:
  2060.             {
  2061.                 if(TeamCash >= 3000)
  2062.                 {
  2063.                     TeamCash -= 3000;
  2064.                     for(int i = 1; i <= MaxClients; ++i)
  2065.                     {
  2066.                         if(client != i)
  2067.                         {
  2068.                             if(IsInGame(i))
  2069.                             {
  2070.                                 Client_PrintToChat(i, true, "%t.", "WhoBuyAmmo", client);
  2071.                                 //Client_PrintToChat(i, true, "{B}%N {R}купил всем патроны за командные очки.", client);
  2072.                             }
  2073.                         }
  2074.                         else
  2075.                         {
  2076.                             if(IsInGame(i))
  2077.                             {
  2078.                                 Client_PrintToChat(i, true, "%t.", "YouBuyAmmo");
  2079.                                 //Client_PrintToChat(i, true, "{B}Вы {R}купили патроны всем выжившим.");
  2080.                             }
  2081.                         }
  2082.                         if(bIsSurvivor(i))
  2083.                         {
  2084.                             GiveFunction(i, "ammo");
  2085.                         }
  2086.                     }
  2087.                 }
  2088.             }
  2089.         }
  2090.     }
  2091.     if(action == MenuAction_Cancel)
  2092.     {
  2093.         if(symbol == MenuCancel_ExitBack)
  2094.         {
  2095.             DisplayMainMenu(client);
  2096.         }
  2097.     }
  2098. }
  2099.  
  2100. public Action vTeamHealUp(Handle timer)
  2101. {
  2102.     for(int i = 1; i <= MaxClients; ++i)
  2103.     {
  2104.         if(bIsSurvivor(i) && !IsPlayerIncaped(i))
  2105.         {
  2106.             int iHeal = GetClientHealth(i);
  2107.             float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
  2108.  
  2109.             if(RoundToCeil(vHealthBuffer) > 0 && iHeal < 100)
  2110.             {
  2111.                 SetEntityHealth(i, iHeal + 1);
  2112.                 SetEntPropFloat(i, Prop_Send, "m_healthBuffer", vHealthBuffer - 1);
  2113.             }
  2114.             else if(iHeal < 100 && vHealthBuffer < 1)
  2115.             {
  2116.                 SetEntityHealth(i, iHeal + 1);
  2117.             }
  2118.         }
  2119.     }
  2120. }
  2121.  
  2122. public Action vTeamPoison(Handle timer, int client)
  2123. {
  2124.     for(int i = 1; i <= MaxClients; ++i)
  2125.     {
  2126.         if(IsValidInfected(i))
  2127.         {
  2128.             ForceDamageEntity(client, 25, i);
  2129.         }
  2130.     }
  2131. }
  2132.  
  2133. public Action vTeamPoisonKill(Handle timer)
  2134. {
  2135.     KillTimer(vPoisonTeam);
  2136.     vPoisonTeam = null;
  2137. }
  2138.  
  2139. void DisplayTransfer(int client)
  2140. {
  2141.     Handle MainTransfer = CreateMenu(MenuTrasnfer);
  2142.     char sStringEx[32];
  2143.     Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransferPlayersList");
  2144.     SetMenuTitle(MainTransfer, sStringEx);
  2145.  
  2146.     char userid[15];
  2147.     char name[32];
  2148.  
  2149.     for (int i = 1; i <= MaxClients; i++)
  2150.     {
  2151.         if (bIsSurvivor(i) && !IsFakeClient(i) && client != i)
  2152.         {
  2153.             IntToString(GetClientUserId(i), userid, 15);
  2154.             GetClientName(i, name, 32);
  2155.             AddMenuItem(MainTransfer, userid, name);
  2156.         }
  2157.     }
  2158.     SetMenuExitBackButton(MainTransfer, true);
  2159.     SetMenuExitButton(MainTransfer, true);
  2160.     DisplayMenu(MainTransfer, client, MENU_TIME_FOREVER);
  2161. }
  2162.  
  2163. void DisplayTransferSecondPart(int client)
  2164. {
  2165.     Handle MainTransferSecond = CreateMenu(MenuTrasnferSecond);
  2166.     char sStringEx[32];
  2167.     Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransfer");
  2168.     SetMenuTitle(MainTransferSecond, sStringEx);
  2169.  
  2170.     AddMenuItem(MainTransferSecond, "0", "10%");
  2171.     AddMenuItem(MainTransferSecond, "1", "20%");
  2172.     AddMenuItem(MainTransferSecond, "2", "30%");
  2173.     AddMenuItem(MainTransferSecond, "3", "40%");
  2174.     AddMenuItem(MainTransferSecond, "4", "50%");
  2175.     AddMenuItem(MainTransferSecond, "5", "60%");
  2176.     AddMenuItem(MainTransferSecond, "6", "70%");
  2177.     AddMenuItem(MainTransferSecond, "7", "80%");
  2178.     AddMenuItem(MainTransferSecond, "8", "90%");
  2179.     AddMenuItem(MainTransferSecond, "9", "100%");
  2180.  
  2181.     SetMenuExitBackButton(MainTransferSecond, true);
  2182.     SetMenuExitButton(MainTransferSecond, true);
  2183.     DisplayMenu(MainTransferSecond, client, MENU_TIME_FOREVER);
  2184. }
  2185.  
  2186. public int MenuTrasnferSecond(Handle MenuTrasnferCallback, MenuAction action, int client, int symbol)
  2187. {
  2188.     if(bIsSurvivor(client))
  2189.     {
  2190.         if (action == MenuAction_End)
  2191.         {
  2192.             CloseHandle(MenuTrasnferCallback);
  2193.             return;
  2194.         }
  2195.  
  2196.         int TrasferCash = Cash[client];
  2197.         int Victim = Target[client];
  2198.         int NumCash = 0;
  2199.         int Percents = 0;
  2200.         symbol += 1;
  2201.         NumCash = RoundToCeil(TrasferCash * (0.1 * symbol));
  2202.         Cash[client] -= NumCash;
  2203.         Cash[Victim] += NumCash;
  2204.         Percents = 10 * symbol;
  2205.         Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
  2206.         Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
  2207.     }
  2208.     if(action == MenuAction_Cancel)
  2209.     {
  2210.         if(symbol == MenuCancel_ExitBack)
  2211.         {
  2212.             DisplayTransfer(client);
  2213.         }
  2214.     }
  2215. }
  2216.  
  2217. public int MenuTrasnfer(Handle CallBackTransfer, MenuAction action, int client, int option)
  2218. {
  2219.     if(bIsSurvivor(client))
  2220.     {
  2221.         if (action == MenuAction_End)
  2222.         {
  2223.             CloseHandle(CallBackTransfer);
  2224.             return;
  2225.         }
  2226.         char userid[15];
  2227.         GetMenuItem(CallBackTransfer, option, userid, 15);
  2228.         int target = GetClientOfUserId(StringToInt(userid));
  2229.         if (bIsSurvivor(target))
  2230.         {
  2231.             DisplayTransferSecondPart(client);
  2232.             Target[client] = target;
  2233.         }
  2234.     }
  2235.     if(action == MenuAction_Cancel)
  2236.     {
  2237.         if(option == MenuCancel_ExitBack)
  2238.         {
  2239.             DisplayMainMenu(client);
  2240.         }
  2241.     }
  2242. }
  2243.  
  2244. void SetArrayValues()
  2245. {
  2246.     g_iArrayCostList[Index_AntiDamage] = GetConVarInt(CostAntiDamage);
  2247.     g_iArrayCostList[Index_Molotov] = GetConVarInt(CostEpicMoli);
  2248.     g_iArrayCostList[Index_FastReload] = GetConVarInt(CostFastReload);
  2249.     g_iArrayCostList[Index_HelpingHand] = GetConVarInt(CostHelpingHand);
  2250.     g_iArrayCostList[Index_MeleeDamage] = GetConVarInt(CostMeleeDamage);
  2251.     g_iArrayCostList[Index_PerfectShove] = GetConVarInt(CostShoveDamage);
  2252.     g_iArrayCostList[Index_StickyPipe] = GetConVarInt(CostPipeIndixite);
  2253.     g_iArrayCostList[Index_SpeedUp] = GetConVarInt(CostSpeedUp);
  2254.     g_iArrayCostList[Index_PipeBomBUltra] = GetConVarInt(CostUltraPipe);
  2255.     g_iArrayCostList[Index_DoubleJump] = GetConVarInt(CostDoubleJump);
  2256.     g_iArrayCostList[Index_Crafting] = GetConVarInt(CostMinecraft);
  2257. }
  2258.  
  2259. void ResetAllPerks()
  2260. {
  2261.     for (int i = 1; i <= MaxClients; i++)
  2262.     {
  2263.         for (int j = 0; j <= 11; j++)
  2264.         {
  2265.             g_GlobalEnabledBool[i][j] = false;
  2266.         }
  2267.     }
  2268. }
  2269.  
  2270. public void SetArray()
  2271. {
  2272.     g_iArrayCostList[Index_AntiDamage] = GetConVarInt(CostAntiDamage);
  2273.     g_iArrayCostList[Index_Molotov] = GetConVarInt(CostEpicMoli);
  2274.     g_iArrayCostList[Index_FastReload] = GetConVarInt(CostFastReload);
  2275.     g_iArrayCostList[Index_HelpingHand] = GetConVarInt(CostHelpingHand);
  2276.     g_iArrayCostList[Index_MeleeDamage] = GetConVarInt(CostMeleeDamage);
  2277.     g_iArrayCostList[Index_PerfectShove] = GetConVarInt(CostShoveDamage);
  2278.     g_iArrayCostList[Index_StickyPipe] = GetConVarInt(CostPipeIndixite);
  2279.     g_iArrayCostList[Index_SpeedUp] = GetConVarInt(CostSpeedUp);
  2280.     g_iArrayCostList[Index_PipeBomBUltra] = GetConVarInt(CostUltraPipe);
  2281.     g_iArrayCostList[Index_DoubleJump] = GetConVarInt(CostDoubleJump);
  2282.     g_iArrayCostList[Index_Crafting] = GetConVarInt(CostMinecraft);
  2283. }
Advertisement
Add Comment
Please, Sign In to add comment