Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SMLib doesn't use new style syntax //What to do then?
- #include <smlib>
- #pragma semicolon 1
- #pragma newdecls required
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #include <skills>
- #if SOURCEMOD_V_MINOR < 7
- #error Sourcemod version is too old!!
- #endif
- #define iTake "ui/bigreward.wav"
- public Plugin myinfo=
- {
- name = "Skills.Core",
- author = "BHaType & Silvers",
- description = "Выжившие могу покупать скилы и перки.",
- version = "6.7.1",
- url = "https://steamcommunity.com/id/fallinourblood/"
- };
- /*
- enum vEnums
- {
- CostAntiDamage,
- CostEpicMoli,
- CostFastReload,
- CostHelpingHand,
- CostMeleeDamage,
- CostShoveDamage,
- CostPipeIndixite,
- CostSpeedUp,
- CostUltraPipe,
- CostDoubleJump,
- CostMinecraft
- }
- */
- ConVar ResetEveryMap;
- ConVar NeedToCraftPills, NeedToCraftAdrenaline, CostEpicMoli, CostEpicMoliUpgrade, CostHelpingHand, CostDoubleJump, CostSpeedUp, CostUpgradePipe,
- CostUltraPipe, CostPipeIndixite, CostShoveDamage, CostAntiDamage, CostMeleeDamage, CostFastReload, CostExpAmmo, CostIncAmmo, CostLaserSight,
- CostExpAmmoPack, CostIncAmmoPack, CostMinecraft, NeedToCraftDefib, NeedToCraftGnome, NeedToCraftMedkit;
- int g_iArrayCostList[12];
- bool g_GlobalEnabledBool[MAXPLAYERS+1][12];
- int Cash[MAXPLAYERS + 1] = 0;
- int TeamCash = 5000;
- int CI[MAXPLAYERS+1] = 0;
- int Target[MAXPLAYERS + 1] = 0;
- int iCountMedkits[MAXPLAYERS + 1];
- int iCraftedMedkits[MAXPLAYERS+1];
- int iCountAdrenalins[MAXPLAYERS + 1] = 0;
- int iCraftedAdrenalins[MAXPLAYERS + 1] = 0;
- int iCountPills[MAXPLAYERS + 1] = 0;
- int iCraftedPills[MAXPLAYERS + 1] = 0;
- int iCountDebifs[MAXPLAYERS + 1] = 0;
- int iCraftedDebifs[MAXPLAYERS + 1] = 0;
- int iCountGnomes[MAXPLAYERS + 1] = 0;
- int iCraftedGnomes[MAXPLAYERS + 1] = 0;
- int iEveryOneAdrenalins = 0;
- int iEveryOnePills = 0;
- int iEveryOneMedkit = 0;
- int iEveryOneDeffibrilator = 0;
- int iEveryOneGnome = 0;
- Handle vHealUpTeam = null;
- Handle vPoisonTeam = null;
- Handle vTimerAdver[MAXPLAYERS+1] = null;
- char sMap[64];
- int vLvLPipes[MAXPLAYERS + 1] = 1;
- int vMaxLvLPipes = 5;
- int iMaxLevelMolo = 6;
- int iCountOfMoliks[MAXPLAYERS + 1] = 1;
- bool IsHelpHand;
- bool Speed_Up;
- bool Ultra_Pipe_Bomb;
- bool Pipa_Velcro;
- bool Perfect_Shove;
- bool Fast_Reload;
- bool Anti_Damage;
- bool MeleeDamage;
- bool Epic_Molotov;
- bool Double_Jump;
- bool Crafting;
- //int iModuleId;
- //Handle g_hGlobalForwardRequest;
- public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
- {
- RegPluginLibrary("Skills.Core");
- RegPluginLibrary("Skills.Anti_Damage");
- RegPluginLibrary("Skills.Epic_Molotov");
- RegPluginLibrary("Skills.Fast_Reload");
- RegPluginLibrary("Skills.Helpin_Hand");
- RegPluginLibrary("Skills.MeleeDamage");
- RegPluginLibrary("Skills.Perfect_Shove");
- RegPluginLibrary("Skills.Pipa_Velcro");
- RegPluginLibrary("Skills.SpeedUp");
- RegPluginLibrary("Skills.Ultra_Pipe_Bomb");
- RegPluginLibrary("Skills.Crafting");
- RegPluginLibrary("Skills.Double_Jump");
- //g_hGlobalForwardRequest = CreateGlobalForward("OnSkillRequest", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
- CreateNative("SetSkillArrayValue", fncSetSkillArrayValue);
- CreateNative("GetStatePerk", PerkGetState);
- //CreateNative("SetCostArrayValue", NAT_SetCostArray);
- return APLRes_Success;
- }
- /*
- pblic int NAT_SetCostArray(Handle plugin, int numParams)
- {
- int iArray = GetNativeCell(1);
- int iCount = GetNativeCell(2);
- g_iArrayCostList[iArray] = iCount;
- }
- */
- public int PerkGetState(Handle plugin, int numParams)
- {
- int client = GetNativeCell(1);
- int PerkId = GetNativeCell(2);
- return g_GlobalEnabledBool[client][PerkId];
- }
- public int fncSetSkillArrayValue(Handle plugin, int numParams)
- {
- int client = GetNativeCell(1);
- int type = GetNativeCell(2);
- switch(type)
- {
- case 0: iCountGnomes[client]++;
- case 1: iCountAdrenalins[client]++;
- case 2: iCountDebifs[client]++
- case 3: iCountPills[client]++;
- case 4: iCountMedkits[client]++;
- }
- }
- public void OnLibraryRemoved(const char[] name)
- {
- if (strcmp(name, "Skills.Helpin_Hand") == 0)
- {
- //iModuleId = 4;
- IsHelpHand = false;
- }
- else if (strcmp(name, "Skills.SpeedUp") == 0)
- {
- //iModuleId = 8;
- Speed_Up = false;
- }
- else if (strcmp(name, "Skills.Ultra_Pipe_Bomb") == 0)
- {
- //iModuleId = 9;
- Ultra_Pipe_Bomb = false;
- }
- else if (strcmp(name, "Skills.Pipa_Velcro") == 0)
- {
- //iModuleId = 7;
- Pipa_Velcro = false;
- }
- else if (strcmp(name, "Skills.Perfect_Shove") == 0)
- {
- //iModuleId = 6;
- Perfect_Shove = false;
- }
- else if (strcmp(name, "Skills.Fast_Reload") == 0)
- {
- //iModuleId = 3;
- Fast_Reload = false;
- }
- else if (strcmp(name, "Skills.Anti_Damage") == 0)
- {
- //iModuleId = 1;
- Anti_Damage = false;
- }
- else if (strcmp(name, "Skills.MeleeDamage") == 0)
- {
- //iModuleId = 5;
- MeleeDamage = false;
- }
- else if (strcmp(name, "Skills.Double_Jump") == 0)
- {
- //iModuleId = 10;
- Double_Jump = false;
- }
- else if (strcmp(name, "Skills.Epic_Molotov") == 0)
- {
- //iModuleId = 2;
- Epic_Molotov = false;
- }
- else if (strcmp(name, "Skills.Crafting") == 0)
- {
- //iModuleId = 11;
- Crafting = false;
- }
- //Call_StartForward(g_hGlobalForwardRequest);
- //Call_PushCell(0);
- //Call_PushCell(iModuleId);
- //Call_PushCell(false);
- //Call_Finish();
- }
- public void OnLibraryAdded(const char[] name)
- {
- if (strcmp(name, "Skills.Helpin_Hand") == 0)
- {
- //iModuleId = 4;
- IsHelpHand = true;
- }
- else if (strcmp(name, "Skills.SpeedUp") == 0)
- {
- //iModuleId = 8;
- Speed_Up = true;
- }
- else if (strcmp(name, "Skills.Ultra_Pipe_Bomb") == 0)
- {
- //iModuleId = 9;
- Ultra_Pipe_Bomb = true;
- }
- else if (strcmp(name, "Skills.Pipa_Velcro") == 0)
- {
- //iModuleId = 7;
- Pipa_Velcro = true;
- }
- else if (strcmp(name, "Skills.Perfect_Shove") == 0)
- {
- //iModuleId = 6;
- Perfect_Shove = true;
- }
- else if (strcmp(name, "Skills.Fast_Reload") == 0)
- {
- //iModuleId = 3;
- Fast_Reload = true;
- }
- else if (strcmp(name, "Skills.Anti_Damage") == 0)
- {
- //iModuleId = 1;
- Anti_Damage = true;
- }
- else if (strcmp(name, "Skills.MeleeDamage") == 0)
- {
- //iModuleId = 5;
- MeleeDamage = true;
- }
- else if (strcmp(name, "Skills.Double_Jump") == 0)
- {
- //iModuleId = 10;
- Double_Jump = true;
- }
- else if (strcmp(name, "Skills.Epic_Molotov") == 0)
- {
- //iModuleId = 2;
- Epic_Molotov = true;
- }
- else if (strcmp(name, "Skills.Crafting") == 0)
- {
- //iModuleId = 11;
- Crafting = true;
- }
- }
- public void OnPluginStart()
- {
- RegAdminCmd("sm_core", Sm_core, ADMFLAG_ROOT);
- RegConsoleCmd("sm_up", BuyMenu);
- RegConsoleCmd("sm_cr", CraftMenu);
- RegAdminCmd("sm_gm", Gm, ADMFLAG_ROOT);
- ResetEveryMap = CreateConVar("vHardReset","0", "Каждую карту будет сброс перков и денег // (1/0)", FCVAR_NONE);
- CostHelpingHand = CreateConVar("vCostHelpHand","16000", "Стоимость перка // Helping Hand", FCVAR_NONE);
- CostDoubleJump = CreateConVar("vCostDoubleJump","14000", "Стоимость перка // Double Jump", FCVAR_NONE);
- CostSpeedUp = CreateConVar("vCostSpeedUp","18000", "Стоимость перка // Speed Up", FCVAR_NONE);
- CostAntiDamage = CreateConVar("vCostAntiDamage","10000", "Стоимость перка // Anti Damage", FCVAR_NONE);
- CostMeleeDamage = CreateConVar("vCostMeleeDamage","14000", "Стоимость перка // Melee Damage", FCVAR_NONE);
- CostFastReload = CreateConVar("vCostFastReload","17500", "Стоимость перка // Fast Reload", FCVAR_NONE);
- CostExpAmmoPack = CreateConVar("vCostExpAmmoPack","3500", "Стоимость осколочных патронов // Pack", FCVAR_NONE);
- CostIncAmmoPack = CreateConVar("vCostIncAmmoPack","3500", "Стоимость зажигательных патронов // Pack", FCVAR_NONE);
- CostExpAmmo = CreateConVar("vCostExpAmmo","3000", "Стоимость осколочных патронов", FCVAR_NONE);
- CostIncAmmo = CreateConVar("vCostIncAmmo","3000", "Стоимость зажигательных патронов", FCVAR_NONE);
- CostLaserSight = CreateConVar("vCostLaserSight","2000", "Стоимость лазера", FCVAR_NONE);
- CostEpicMoli = CreateConVar("vCostEpicMolo","17000", "Стоимость перка // Epic Moli", FCVAR_NONE);
- CostEpicMoliUpgrade = CreateConVar("vCostEpicMoloUpgrade","3500", "Стоимость апгрейда перка // Epic Moli", FCVAR_NONE);
- NeedToCraftGnome = CreateConVar("vNumberToCraftGnome","60", "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
- NeedToCraftDefib = CreateConVar("vNumberToCraftDefib","30", "Сколько нужно частей чтобы скрафтить дефиб", FCVAR_NONE);
- NeedToCraftAdrenaline = CreateConVar("vNumberToCraftAdrenaline","10", "Сколько нужно частей чтобы скрафтить адреналин", FCVAR_NONE);
- NeedToCraftPills = CreateConVar("vNumberToCraftPills","10", "Сколько нужно частей чтобы скрафтить таблетки", FCVAR_NONE);
- NeedToCraftMedkit = CreateConVar("vNumberToCraftMedkit","20", "Сколько нужно частей чтобы скрафтить аптечку", FCVAR_NONE);
- CostMinecraft = CreateConVar("vCostCraftPerk","11000", "Стоимость перка // Craft", FCVAR_NONE);
- CostUpgradePipe = CreateConVar("vCostUpgradePipe","2500", "Стоимость апгрейда перка // Ultra Pipe Bomb", FCVAR_NONE);
- CostUltraPipe = CreateConVar("vCostUltraPipe","20000", "Стоимость перка // Ultra Pipe", FCVAR_NONE);
- CostPipeIndixite = CreateConVar("vCostStickyPipes","250", "Стоимость перка // Sticky Pipes", FCVAR_NONE);
- CostShoveDamage = CreateConVar("vCostPerfectDamage","12999", "Стоимость перка // Perfect Shove", FCVAR_NONE);
- SetArrayValues();
- AutoExecConfig(true, "L4D2_Skills");
- LoadTranslations("Skills.phrases");
- }
- public void OnMapStart()
- {
- if(GetConVarInt(ResetEveryMap) == 0)
- {
- GetCurrentMap(sMap, sizeof(sMap));
- if(StrContains(sMap, "m1_", true) > 1)
- {
- for(int i = 0; i <= MaxClients; ++i)
- {
- Cash[i] = 0;
- TeamCash = 5000;
- CI[i] = 0;
- if(vTimerAdver[i] != null)
- {
- KillTimer(vTimerAdver[i]);
- vTimerAdver[i] = null;
- }
- if(vTimerAdver[i] != null)
- {
- KillTimer(vTimerAdver[i]);
- vTimerAdver[i] = null;
- }
- iCraftedAdrenalins[i] = 0;
- iCountAdrenalins[i]
- iCountPills[i] = 0;
- iCraftedPills[i] = 0;
- iCraftedMedkits[i] = 0;
- iCountMedkits[i] = 0;
- }
- ResetAllPerks();
- if(vHealUpTeam != null)
- {
- KillTimer(vHealUpTeam);
- vHealUpTeam = null;
- }
- }
- }
- int iCountMedkits[MAXPLAYERS + 1];
- int iCraftedMedkits[MAXPLAYERS+1];
- int iCountAdrenalins[MAXPLAYERS + 1] = 0;
- int iCraftedAdrenalins[MAXPLAYERS + 1] = 0;
- int iCountPills[MAXPLAYERS + 1] = 0;
- int iCraftedPills[MAXPLAYERS + 1] = 0;
- int iCountDebifs[MAXPLAYERS + 1] = 0;
- int iCraftedDebifs[MAXPLAYERS + 1] = 0;
- int iCountGnomes[MAXPLAYERS + 1] = 0;
- int iCraftedGnomes[MAXPLAYERS + 1] = 0;
- int iEveryOneAdrenalins = 0;
- int iEveryOnePills = 0;
- int iEveryOneMedkit = 0;
- int iEveryOneDeffibrilator = 0;
- int iEveryOneGnome = 0;
- else
- {
- for(int i = 1; i <= MaxClients; ++i)
- {
- Cash[i] = 0;
- TeamCash = 5000;
- CI[i] = 0;
- if(vTimerAdver[i] != null)
- {
- KillTimer(vTimerAdver[i]);
- vTimerAdver[i] = null;
- }
- iCountAdrenalins[i] = 0;
- iCraftedAdrenalins[i] = 0;
- iCountPills[i] = 0;
- iCraftedPills[i] = 0;
- iCraftedMedkits[i] = 0;
- iCountMedkits[i] = 0;
- }
- ResetAllPerks();
- if(vHealUpTeam != null)
- {
- KillTimer(vHealUpTeam);
- vHealUpTeam = null;
- }
- }
- if(vPoisonTeam != null)
- {
- KillTimer(vPoisonTeam);
- vPoisonTeam = null;
- }
- }
- public Action Sm_core(int client, int args)
- {
- PrintToChatAll("int g_iArrayCostList = %i", g_iArrayCostList[args]);
- PrintToChatAll("bool IsHelpHand = %b", IsHelpHand);
- PrintToChatAll("bool Speed_Up = %b", Speed_Up);
- PrintToChatAll("bool Ultra_Pipe_Bomb = %b", Ultra_Pipe_Bomb);
- PrintToChatAll("bool Pipa_Velcro = %b", Pipa_Velcro);
- PrintToChatAll("bool Perfect_Shove = %b", Perfect_Shove);
- PrintToChatAll("bool Fast_Reload = %b", Fast_Reload);
- PrintToChatAll("bool Anti_Damage = %b", Anti_Damage);
- PrintToChatAll("bool MeleeDamage = %b", MeleeDamage);
- PrintToChatAll("bool Epic_Molotov = %b", Epic_Molotov);
- PrintToChatAll("bool Double_Jump = %b", Double_Jump);
- PrintToChatAll("bool Crafting = %b", Crafting);
- }
- public Action CraftMenu(int client, int args)
- {
- if(bIsSurvivor(client))
- {
- DisplayCraftMenu(client);
- }
- }
- public Action EventWitchKill(Event event, const char[] name, bool dontBroadcast)
- {
- int attacker = GetClientOfUserId(GetEventInt(event,"userid"));
- if(bIsSurvivor(attacker))
- {
- int random = GetRandomInt(250, 2500) * 2;
- Cash[attacker] += random;
- Client_PrintToChat(attacker, true, "%t", "WitchKilled", random);
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(IsClientInGame(i) && i != attacker)
- {
- Client_PrintToChat(i, true, "%t", "WhoWitchKilled", attacker, random);
- }
- }
- }
- }
- public Action EventInfDeath(Event event, const char[] name, bool dontBroadcast)
- {
- int attacker = GetClientOfUserId(GetEventInt(event,"attacker"));
- if(vTimerAdver[attacker] == null)
- {
- vTimerAdver[attacker] = CreateTimer(70.0, Advertisement, attacker);
- }
- CI[attacker]++;
- }
- public Action Advertisement(Handle timer, int attacker)
- {
- int total = GetRandomInt(0, 30) * CI[attacker] * GetRandomInt(1, 3);
- if(bIsSurvivor(attacker) && total != 1702257729 && CI[attacker] != 1702257729)
- {
- Client_PrintToChat(attacker, true, "%t", "AdvertisementHowManyCommonsKilled", total, CI[attacker]);
- }
- Cash[attacker] += total;
- CI[attacker] = 0;
- KillTimer(vTimerAdver[attacker]);
- vTimerAdver[attacker] = null;
- }
- public Action EventDeath(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- int attacker = GetClientOfUserId(event.GetInt("attacker"));
- if(IsValidInfected(client))
- {
- if(bIsSurvivor(attacker))
- {
- int Number;
- int vClass = GetEntProp(client, Prop_Send, "m_zombieClass");
- switch(vClass)
- {
- case 1:
- {
- float rFloat = GetRandomFloat(1.0, 2.5);
- Number = GetRandomInt(200, 625);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledSmoker", Total);
- }
- case 2:
- {
- float rFloat = GetRandomFloat(1.0, 4.0);
- Number = GetRandomInt(200, 300);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledBoomer", Total);
- }
- case 3:
- {
- float rFloat = GetRandomFloat(1.0, 3.0);
- Number = GetRandomInt(350, 475);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledHunter", Total);
- }
- case 4:
- {
- float rFloat = GetRandomFloat(1.0, 3.5);
- Number = GetRandomInt(150, 175);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledSpitter", Total);
- }
- case 5:
- {
- float rFloat = GetRandomFloat(1.0, 2.5);
- Number = GetRandomInt(200, 350);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledJockey", Total);
- }
- case 6:
- {
- float rFloat = GetRandomFloat(1.0, 3.5);
- Number = GetRandomInt(300, 650);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledCharger", Total);
- }
- case 8:
- {
- float rFloat = GetRandomFloat(1.0, 2.1);
- Number = GetRandomInt(2100, 2850);
- int Total = RoundToCeil(Number * rFloat);
- Cash[attacker] += Total;
- Client_PrintToChat(attacker, true, "%t", "KilledTank", Total);
- }
- }
- TeamCash += Number;
- }
- }
- }
- public Action Gm(int client,int args)
- {
- Cash[client] += 100000;
- }
- public Action BuyMenu(int client,int args)
- {
- if(bIsSurvivor(client))
- {
- DisplayMainMenu(client);
- }
- }
- public int MainBox(Handle DontLook, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(DontLook);
- return;
- }
- if (action == MenuAction_Select)
- {
- switch(symbol)
- {
- case 0:
- {
- DisplayStatisticMenu(client);
- }
- case 1:
- {
- DisplayPerksPassiveMenu(client);
- }
- case 2:
- {
- DisplayPerksMenu(client);
- }
- case 3:
- {
- DisplayTransfer(client);
- }
- case 4:
- {
- DisplayBankTo(client);
- }
- case 5:
- {
- DisplayTeamHelp(client);
- }
- case 6:
- {
- DisplayShop(client);
- }
- case 7:
- {
- DisplayCraftMenu(client);
- }
- case 8:
- {
- DisplayInvectory(client);
- }
- case 9:
- {
- DisplayBag(client);
- }
- case 10:
- {
- DisplayEveryOneBag(client);
- }
- }
- }
- }
- void DisplayInvectory(int client)
- {
- Handle BagDisplay = CreateMenu(MyInvMenu);
- //char sTitle[56];
- SetMenuTitle(BagDisplay, "%t", "InvectoryMenuTitle");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "InvCountMedkits", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit));
- AddMenuItem(BagDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "InvCountPills", iCountPills[client], GetConVarInt(NeedToCraftPills));
- AddMenuItem(BagDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "InvCountAdrenalins", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline));
- AddMenuItem(BagDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDefibs", iCountDebifs[client], GetConVarInt(NeedToCraftDefib));
- AddMenuItem(BagDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "InvCountDwarfs", iCountGnomes[client], GetConVarInt(NeedToCraftGnome));
- AddMenuItem(BagDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
- SetMenuExitBackButton(BagDisplay, true);
- SetMenuExitButton(BagDisplay, true);
- DisplayMenu(BagDisplay, client, MENU_TIME_FOREVER);
- }
- public int MyInvMenu(Handle MinecraftCallback, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(MinecraftCallback);
- return;
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- public int MyBagMenu(Handle BagCallback, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(BagCallback);
- return;
- }
- switch(symbol)
- {
- case 0:
- {
- if(iCraftedMedkits[client] > 0)
- {
- iCraftedMedkits[client]--;
- GiveFunction(client, "first_aid_kit");
- Client_PrintToChat(client, true, "%t", "YouTakeFromBagMedkit", iCraftedMedkits[client]);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedMedkits");
- }
- }
- case 1:
- {
- if(iCraftedPills[client] > 0)
- {
- iCraftedPills[client]--;
- GiveFunction(client, "pain_pills");
- Client_PrintToChat(client, true, "%t", "YouTakeFromBagPills", iCraftedPills[client]);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedPills");
- }
- }
- case 2:
- {
- if(iCraftedAdrenalins[client] > 0)
- {
- iCraftedAdrenalins[client]--;
- GiveFunction(client, "adrenaline");
- Client_PrintToChat(client, true, "%t", "YouTakeFromBagAdrenaline", iCraftedAdrenalins[client]);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedAdrenaline");
- }
- }
- case 3:
- {
- if(iCraftedDebifs[client] > 0)
- {
- iCraftedDebifs[client]--;
- GiveFunction(client, "defibrillator");
- Client_PrintToChat(client, true, "%t", "YouTakeFromBagDefib", iCraftedDebifs[client]);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDefibs");
- }
- }
- case 4:
- {
- if(iCraftedGnomes[client] > 0)
- {
- iCraftedAdrenalins[client]--;
- GiveFunction(client, "gnome");
- Client_PrintToChat(client, true, "%t", "YouTakeFromBagDwarf", iCraftedGnomes[client]);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouDontHaveCraftedDwarfs");
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayEveryOneBag(int client)
- {
- Handle MainMenuDisplay = CreateMenu(EveryOneDisplayBag);
- //char sTitle[56];
- SetMenuTitle(MainMenuDisplay, "%t", "EveryOneBag");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "BagEveryOneTransfer", iEveryOneMedkit);
- AddMenuItem(MainMenuDisplay, "0", sStringEx);
- if(iEveryOneMedkit > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit);
- AddMenuItem(MainMenuDisplay, "1", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iEveryOneMedkit);
- AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iEveryOnePills > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills);
- AddMenuItem(MainMenuDisplay, "2", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iEveryOnePills);
- AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iEveryOneAdrenalins > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins);
- AddMenuItem(MainMenuDisplay, "3", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iEveryOneAdrenalins);
- AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iEveryOneDeffibrilator > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator);
- AddMenuItem(MainMenuDisplay, "4", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iEveryOneDeffibrilator);
- AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iEveryOneGnome > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome);
- AddMenuItem(MainMenuDisplay, "5", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iEveryOneGnome);
- AddMenuItem(MainMenuDisplay, "5", sStringEx, ITEMDRAW_DISABLED);
- }
- SetMenuExitBackButton(MainMenuDisplay, true);
- SetMenuExitButton(MainMenuDisplay, true);
- DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
- }
- void DisplayEveryOneTransferint(int client)
- {
- Handle MainMenuDisplay = CreateMenu(EvetyOneTransfer);
- //char sTitle[56];
- SetMenuTitle(MainMenuDisplay, "%t", "EveryoneBagTransfer");
- char sStringEx[64];
- if(iCraftedMedkits[client] > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
- AddMenuItem(MainMenuDisplay, "0", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
- AddMenuItem(MainMenuDisplay, "0", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iCraftedPills[client] > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
- AddMenuItem(MainMenuDisplay, "1", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
- AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iCraftedAdrenalins[client] > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
- AddMenuItem(MainMenuDisplay, "2", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
- AddMenuItem(MainMenuDisplay, "2", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iCraftedDebifs[client] > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
- AddMenuItem(MainMenuDisplay, "3", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
- AddMenuItem(MainMenuDisplay, "3", sStringEx, ITEMDRAW_DISABLED);
- }
- if(iCraftedGnomes[client] > 0)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
- AddMenuItem(MainMenuDisplay, "4", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
- AddMenuItem(MainMenuDisplay, "4", sStringEx, ITEMDRAW_DISABLED);
- }
- SetMenuExitBackButton(MainMenuDisplay, true);
- SetMenuExitButton(MainMenuDisplay, true);
- DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
- }
- public int EvetyOneTransfer(Handle BagCallback, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(BagCallback);
- return;
- }
- switch(symbol)
- {
- case 0:
- {
- iCraftedMedkits[client]--;
- iEveryOneMedkit++;
- Client_PrintToChatAll(true, "%t", "SomeonePutMedkitToBagEveryone", client);
- }
- case 1:
- {
- iCraftedPills[client]--;
- iEveryOneMedkit++;
- Client_PrintToChatAll(true, "%t", "SomeonePutPillsToBagEveryone", client);
- }
- case 2:
- {
- iCraftedAdrenalins[client]--;
- iEveryOneMedkit++;
- Client_PrintToChatAll(true, "%t", "SomeonePutAdrenalineToBagEveryone", client);
- }
- case 3:
- {
- iCraftedDebifs[client]--;
- iEveryOneMedkit++;
- Client_PrintToChatAll(true, "%t", "SomeonePutDefibToBagEveryone", client);
- }
- case 4:
- {
- iCraftedGnomes[client]--;
- iEveryOneMedkit++;
- Client_PrintToChatAll(true, "%t", "SomeonePutGnomeToBagEveryone", client);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayEveryOneBag(client);
- }
- }
- }
- public int EveryOneDisplayBag(Handle BagCallback, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(BagCallback);
- return;
- }
- switch(symbol)
- {
- case 0:
- {
- DisplayEveryOneTransferint(client);
- }
- case 1:
- {
- if(iEveryOneMedkit > 0)
- {
- iEveryOneMedkit--;
- GiveFunction(client, "first_aid_kit");
- Client_PrintToChatAll(true, "%t", "EveryOneTakenMedkit", client);
- }
- }
- case 2:
- {
- if(iEveryOnePills > 0)
- {
- iEveryOnePills--;
- GiveFunction(client, "pills");
- Client_PrintToChatAll(true, "%t", "EveryOneTakenPills", client);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "EvetyOneBagNotPills");
- }
- }
- case 3:
- {
- if(iEveryOneAdrenalins > 0)
- {
- iEveryOneAdrenalins--;
- GiveFunction(client, "adrenaline");
- Client_PrintToChatAll(true, "%t", "EveryOneTakenAdrenaline", client);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "EvetyOneBagNotAdrenalins");
- }
- }
- case 4:
- {
- if(iEveryOneDeffibrilator > 0)
- {
- iEveryOneDeffibrilator--;
- GiveFunction(client, "defibrillator");
- Client_PrintToChatAll(true, "%t", "EveryOneTakenDefibs", client);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "EvetyOneBagNotDefibs");
- }
- }
- case 5:
- {
- if(iEveryOneGnome > 0)
- {
- iEveryOneGnome--;
- GiveFunction(client, "gnome");
- Client_PrintToChatAll(true, "%t", "EveryOneTakenGnome", client);
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "EvetyOneBagNotGnome");
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayBag(int client)
- {
- Handle MainMenuDisplay = CreateMenu(MyBagMenu);
- //char sTitle[56];
- SetMenuTitle(MainMenuDisplay, "%t", "MyBagTitle");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMedkitsCount", iCraftedMedkits[client]);
- AddMenuItem(MainMenuDisplay, "0", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "BagPillsCount", iCraftedPills[client]);
- AddMenuItem(MainMenuDisplay, "1", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "BagAdrenalineCount", iCraftedAdrenalins[client]);
- AddMenuItem(MainMenuDisplay, "2", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDefibsCount", iCraftedDebifs[client]);
- AddMenuItem(MainMenuDisplay, "3", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "BagDwarfCount", iCraftedGnomes[client]);
- AddMenuItem(MainMenuDisplay, "4", sStringEx);
- SetMenuExitBackButton(MainMenuDisplay, true);
- SetMenuExitButton(MainMenuDisplay, true);
- DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
- }
- void DisplayCraftMenu(int client)
- {
- Handle MainMenuDisplay = CreateMenu(Minecraft);
- //char sTitle[56];
- SetMenuTitle(MainMenuDisplay, "%t", "CraftMenuTitle");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "CraftMedkit", iCountMedkits[client], GetConVarInt(NeedToCraftMedkit));
- AddMenuItem(MainMenuDisplay, "0", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "CraftPills", iCountPills[client], GetConVarInt(NeedToCraftPills));
- AddMenuItem(MainMenuDisplay, "1", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "CraftAdrenaline", iCountAdrenalins[client], GetConVarInt(NeedToCraftAdrenaline));
- AddMenuItem(MainMenuDisplay, "2", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "CraftDefib", iCountDebifs[client], GetConVarInt(NeedToCraftDefib));
- AddMenuItem(MainMenuDisplay, "3", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "CraftGnome", iCountGnomes[client], GetConVarInt(NeedToCraftGnome));
- AddMenuItem(MainMenuDisplay, "4", sStringEx);
- SetMenuExitBackButton(MainMenuDisplay, true);
- SetMenuExitButton(MainMenuDisplay, true);
- DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
- }
- public int Minecraft(Handle MinecraftCallback, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(MinecraftCallback);
- return;
- }
- if(bIsSurvivor(client))
- {
- char iItem[32];
- GetMenuItem(MinecraftCallback, symbol, iItem, sizeof(iItem));
- symbol = StringToInt(iItem);
- switch(symbol)
- {
- case 0:
- {
- if (iCountMedkits[client] >= GetConVarInt(NeedToCraftMedkit))
- {
- iCountMedkits[client] -= GetConVarInt(NeedToCraftMedkit);
- iCraftedMedkits[client]++;
- Client_PrintToChat(client, true, "%t", "YouCraftedMedkit");
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfMedkits", GetConVarInt(NeedToCraftMedkit) - iCountMedkits[client]);
- }
- }
- case 1:
- {
- if(iCountPills[client] >= GetConVarInt(NeedToCraftPills))
- {
- iCountPills[client] -= GetConVarInt(NeedToCraftPills);
- iCraftedPills[client]++;
- Client_PrintToChat(client, true, "%t", "YouCraftedPills");
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfPills", GetConVarInt(NeedToCraftPills) - iCountPills[client]);
- }
- }
- case 2:
- {
- if(iCountAdrenalins[client] >= GetConVarInt(NeedToCraftAdrenaline))
- {
- iCountAdrenalins[client] -= GetConVarInt(NeedToCraftAdrenaline);
- iCraftedAdrenalins[client]++;
- Client_PrintToChat(client, true, "%t", "YouCraftedAdrenaline");
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfAdrenaline", GetConVarInt(NeedToCraftAdrenaline) - iCountAdrenalins[client]);
- }
- }
- case 3:
- {
- if(iCountDebifs[client] >= GetConVarInt(NeedToCraftDefib))
- {
- iCountDebifs[client] -= GetConVarInt(NeedToCraftDefib);
- iCraftedDebifs[client]++;
- Client_PrintToChat(client, true, "%t", "YouCraftedDefib");
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfDefib", GetConVarInt(NeedToCraftDefib) - iCountDebifs[client]);
- }
- }
- case 4:
- {
- if(iCountGnomes[client] >= GetConVarInt(NeedToCraftGnome))
- {
- iCountAdrenalins[client] -= GetConVarInt(NeedToCraftGnome);
- iCraftedGnomes[client]++;
- Client_PrintToChat(client, true, "%t", "YouCraftedGnome");
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "YouNeedMorePiecesOfGnome", GetConVarInt(NeedToCraftAdrenaline) - iCountGnomes[client]);
- }
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayMainMenu(int client)
- {
- Handle MainMenuDisplay = CreateMenu(MainBox);
- //char sTitle[56];
- SetMenuTitle(MainMenuDisplay, "%t", "MainMenuTitle");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "Stats");
- AddMenuItem(MainMenuDisplay, "0", sStringEx);
- if(!Fast_Reload && !IsHelpHand && !Anti_Damage && !Speed_Up && !MeleeDamage)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "Passive Perks");
- AddMenuItem(MainMenuDisplay, "1", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "Passive Perks");
- AddMenuItem(MainMenuDisplay, "1", sStringEx);
- }
- Format(sStringEx, sizeof(sStringEx), "%t", "Perks");
- AddMenuItem(MainMenuDisplay, "2", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "TrasferOfMoney");
- AddMenuItem(MainMenuDisplay, "3", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "TransferToTeamBank");
- AddMenuItem(MainMenuDisplay, "4", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamImprovements");
- AddMenuItem(MainMenuDisplay, "5", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "ShopMainMenu");
- AddMenuItem(MainMenuDisplay, "6", sStringEx);
- if(Crafting)
- {
- if(GetStatePerk(client, Index_Crafting))
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu");
- AddMenuItem(MainMenuDisplay, "7", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "CrafMainMenu");
- AddMenuItem(MainMenuDisplay, "7", sStringEx, ITEMDRAW_DISABLED);
- }
- Format(sStringEx, sizeof(sStringEx), "%t", "InventoryMainMenu");
- AddMenuItem(MainMenuDisplay, "8", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "BagMainMenu");
- AddMenuItem(MainMenuDisplay, "9", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "EveryOneBagMenu");
- AddMenuItem(MainMenuDisplay, "10", sStringEx);
- }
- SetMenuExitButton(MainMenuDisplay, true);
- DisplayMenu(MainMenuDisplay, client, MENU_TIME_FOREVER);
- }
- void DisplayPerksPassiveMenu(int client)
- {
- Handle MainPassivePerks = CreateMenu(MainPerksPassiveMenu);
- SetMenuTitle(MainPassivePerks, "%t", "TitleMenuPassivePerks");
- char sStringEx[128];
- if(IsHelpHand)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkHelpingHand", GetConVarInt(CostHelpingHand));
- if(g_GlobalEnabledBool[client][Index_HelpingHand])
- {
- AddMenuItem(MainPassivePerks, "4", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "4", sStringEx);
- }
- }
- if(Speed_Up)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkSpeedUp", GetConVarInt(CostSpeedUp));
- if(g_GlobalEnabledBool[client][Index_SpeedUp])
- {
- AddMenuItem(MainPassivePerks, "8", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "8", sStringEx);
- }
- }
- if(Double_Jump)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkDoubleJump", GetConVarInt(CostDoubleJump));
- if(g_GlobalEnabledBool[client][Index_DoubleJump])
- {
- AddMenuItem(MainPassivePerks, "10", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "10", sStringEx);
- }
- }
- if(Anti_Damage)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkAntiDamage", GetConVarInt(CostAntiDamage));
- if(g_GlobalEnabledBool[client][Index_AntiDamage])
- {
- AddMenuItem(MainPassivePerks, "1", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "1", sStringEx);
- }
- }
- if(MeleeDamage)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "MeleeDamage", GetConVarInt(CostMeleeDamage));
- if(g_GlobalEnabledBool[client][Index_MeleeDamage])
- {
- AddMenuItem(MainPassivePerks, "5", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "5", sStringEx);
- }
- }
- if(Fast_Reload)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "FastRealodPerk", GetConVarInt(CostFastReload));
- if(g_GlobalEnabledBool[client][Index_FastReload])
- {
- AddMenuItem(MainPassivePerks, "3", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- AddMenuItem(MainPassivePerks, "3", sStringEx);
- }
- }
- SetMenuExitBackButton(MainPassivePerks, true);
- SetMenuExitButton(MainPassivePerks, true);
- DisplayMenu(MainPassivePerks, client, MENU_TIME_FOREVER);
- }
- public int MainPerksPassiveMenu(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
- {
- if(action == MenuAction_Cancel )
- {
- if(symbol == MenuCancel_ExitBack)
- DisplayMainMenu(client);
- }
- else if( action == MenuAction_Select )
- {
- char iItem[32];
- GetMenuItem(TeamUpgradeMenu, symbol, iItem, sizeof(iItem));
- symbol = StringToInt(iItem);
- if(bIsSurvivor(client))
- {
- if(Cash[client] >= g_iArrayCostList[symbol])
- {
- PrintToChatAll("%i", symbol);
- DisplayMainMenu(client);
- Cash[client] -= g_iArrayCostList[symbol];
- //SendGlobalForward(client, symbol, true);
- g_GlobalEnabledBool[client][symbol] = true;
- Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[symbol]);
- }
- }
- }
- }
- /*
- void SendGlobalForward(int client, int type, bool status)
- {
- Call_StartForward(g_hGlobalForwardRequest);
- Call_PushCell(client);
- Call_PushCell(type);
- Call_PushCell(status);
- Call_Finish();
- }
- */
- void ShowPerksPanelUpgradePipe(int client)
- {
- Handle PerksUpgrade = CreatePanel();
- if(vLvLPipes[client] < vMaxLvLPipes)
- {
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkNameOfUpgradePipeBomb");
- char sPanelEx[32];
- Format(sPanelEx, sizeof(sPanelEx), "%t", "TitleOfUpgradePipeBomb");
- SetPanelTitle(PerksUpgrade, sPanelEx);
- DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomblvl", vLvLPipes[client]);
- DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "CostOfUpgradePipeBomb", GetConVarInt(CostUpgradePipe));
- DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "CountOfPipesOfPerkPipeBomb", vLvLPipes[client]);
- DrawPanelItem(PerksUpgrade, sStringEx, ITEMDRAW_DISABLED);
- DrawPanelItem(PerksUpgrade, "Прокачать");
- DrawPanelItem(PerksUpgrade, "Выйти");
- SendPanelToClient(PerksUpgrade, client, PerksUpgradeCallback, 0);
- CloseHandle(PerksUpgrade);
- }
- else
- {
- Client_PrintToChat(client, true, "{R}Вы {L}достигли макс. уровня перка(Пайпо Мёт)");
- }
- }
- public int PerksUpgradeCallback(Handle panel, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(panel);
- return;
- }
- if( action == MenuAction_Select )
- {
- switch(symbol)
- {
- case 5:
- {
- if(Cash[client] >= GetConVarInt(CostUpgradePipe))
- {
- Cash[client] -= GetConVarInt(CostUpgradePipe);
- vLvLPipes[client]++;
- Client_PrintToChat(client, true, "%t", "YouHasBeenUpgradedPipeBomb");
- Client_PrintToChat(client, true, "%t", "CountOfPipesPerk", vLvLPipes[client]);
- DisplayMainMenu(client);
- }
- }
- }
- }
- else if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayPerksMenu(client);
- }
- }
- }
- void DisplayPerksMenu(int client)
- {
- Handle MainPerks = CreateMenu(MainPerksMenu);
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "TitleNameOfMenuPerks");
- SetMenuTitle(MainPerks, sStringEx);
- if(Ultra_Pipe_Bomb)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBombUpgrade++", GetConVarInt(CostUpgradePipe));
- if(g_GlobalEnabledBool[client][Index_PipeBomBUltra])
- {
- AddMenuItem(MainPerks, "9", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkPipeBomb", GetConVarInt(CostUltraPipe));
- AddMenuItem(MainPerks, "9", sStringEx);
- }
- }
- if(Pipa_Velcro)
- {
- if(!g_GlobalEnabledBool[client][Index_StickyPipe])
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
- AddMenuItem(MainPerks, "7", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "StickyPipeBomb", GetConVarInt(CostPipeIndixite));
- AddMenuItem(MainPerks, "7", sStringEx, ITEMDRAW_DISABLED);
- }
- }
- if(Perfect_Shove)
- {
- if(!g_GlobalEnabledBool[client][Index_PerfectShove])
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
- AddMenuItem(MainPerks, "6", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "ShoveDamage", GetConVarInt(CostShoveDamage));
- AddMenuItem(MainPerks, "6", sStringEx, ITEMDRAW_DISABLED);
- }
- }
- if(Crafting)
- {
- if(!g_GlobalEnabledBool[client][Index_Crafting])
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
- AddMenuItem(MainPerks, "11", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkCrafting", GetConVarInt(CostMinecraft));
- AddMenuItem(MainPerks, "11", sStringEx, ITEMDRAW_DISABLED);
- }
- }
- if(Epic_Molotov)
- {
- if(!g_GlobalEnabledBool[client][Index_Molotov])
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov", GetConVarInt(CostEpicMoli));
- AddMenuItem(MainPerks, "2", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "PerkEpicMolotov++", GetConVarInt(CostEpicMoliUpgrade));
- AddMenuItem(MainPerks, "2", sStringEx);
- }
- }
- SetMenuExitBackButton(MainPerks, true);
- SetMenuExitButton(MainPerks, true);
- DisplayMenu(MainPerks, client, MENU_TIME_FOREVER);
- }
- public int MainPerksMenu(Handle TransferMenu, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(TransferMenu);
- return 0;
- }
- if(action == MenuAction_Select)
- {
- char iItem[32];
- GetMenuItem(TransferMenu, symbol, iItem, sizeof(iItem));
- symbol = StringToInt(iItem);
- switch(symbol)
- {
- case 9:
- {
- if(!g_GlobalEnabledBool[client][Index_PipeBomBUltra])
- {
- if(Cash[client] >= g_iArrayCostList[Index_PipeBomBUltra])
- {
- Cash[client] -= g_iArrayCostList[Index_PipeBomBUltra];
- g_GlobalEnabledBool[client][Index_PipeBomBUltra] = true;
- //SendGlobalForward(client, Index_PipeBomBUltra, true);
- Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[Index_PipeBomBUltra]);
- DisplayMainMenu(client);
- }
- }
- else
- {
- ShowPerksPanelUpgradePipe(client);
- }
- }
- case 2:
- {
- if(!g_GlobalEnabledBool[client][Index_Molotov])
- {
- if(Cash[client] >= g_iArrayCostList[Index_Molotov])
- {
- Cash[client] -= g_iArrayCostList[Index_Molotov];
- g_GlobalEnabledBool[client][symbol] = true;
- //SendGlobalForward(client, Index_StickyPipe, true);
- Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[Index_Molotov]);
- DisplayMainMenu(client);
- }
- }
- else
- {
- DisplayUpgradeMolotov(client);
- }
- }
- default:
- {
- if(Cash[client] < g_iArrayCostList[symbol]) return 0;
- Cash[client] -= g_iArrayCostList[symbol];
- //SendGlobalForward(client, symbol, true);
- g_GlobalEnabledBool[client][symbol] = true;
- Client_PrintToChat(client, true, "{B}-%i", g_iArrayCostList[symbol]);
- DisplayMainMenu(client);
- }
- }
- }
- else if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- return 0;
- }
- void DisplayUpgradeMolotov(int client)
- {
- Handle MolikUp = CreateMenu(UpgradeMoloCall);
- int iLevel = iCountOfMoliks[client];
- int iLevelM = iCountOfMoliks[client] + 1;
- //char sTitle[56];
- SetMenuTitle(MolikUp, "%t", "UpgradeMolotovTitle");
- char sStringEx[128];
- Format(sStringEx, sizeof(sStringEx), "%t", "NameOfPerkMolotov");
- AddMenuItem(MolikUp, "0", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "CostUpgradeMolotov", GetConVarInt(CostEpicMoliUpgrade));
- AddMenuItem(MolikUp, "1", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovs", iLevel, iMaxLevelMolo);
- AddMenuItem(MolikUp, "2", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "CountOfMolotovsOnNextLevel", iLevelM);
- AddMenuItem(MolikUp, "3", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "LevelOfPerk", iLevel);
- AddMenuItem(MolikUp, "4", sStringEx, ITEMDRAW_DISABLED);
- Format(sStringEx, sizeof(sStringEx), "%t", "UpgradeMolikButton");
- AddMenuItem(MolikUp, "5", sStringEx);
- SetMenuExitBackButton(MolikUp, true);
- SetMenuExitButton(MolikUp, true);
- DisplayMenu(MolikUp, client, MENU_TIME_FOREVER);
- }
- public int UpgradeMoloCall(Handle Shop, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(Shop);
- return;
- }
- if( action == MenuAction_Select )
- {
- switch(symbol)
- {
- case 5:
- {
- if(iCountOfMoliks[client] < iMaxLevelMolo)
- {
- if(Cash[client] >= GetConVarInt(CostEpicMoliUpgrade))
- {
- Cash[client] -= GetConVarInt(CostEpicMoliUpgrade);
- iCountOfMoliks[client]++;
- Client_PrintToChat(client, true, "%t", "YouUpgradedMolotov", iCountOfMoliks[client], iMaxLevelMolo);
- Client_PrintToChat(client, true, "%t", "CountOfMolotovUpgraded", iCountOfMoliks[client]);
- DisplayMainMenu(client);
- }
- }
- else
- {
- Client_PrintToChat(client, true, "%t", "MaxLevelOfMolotov");
- DisplayMainMenu(client);
- }
- }
- }
- }
- else if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayStatisticMenu(int client)
- {
- Handle MainStats = CreateMenu(MainStatsMenu);
- char sItemEx[56];
- Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuStatistic");
- SetMenuTitle(MainStats, sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "YourMoney", Cash[client]);
- AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
- Format(sItemEx, sizeof(sItemEx), "%t", "TeamCash", TeamCash);
- AddMenuItem(MainStats, sItemEx, sItemEx, ITEMDRAW_DISABLED);
- AddMenuItem(MainStats, "777", "Soon...", ITEMDRAW_DISABLED);
- SetMenuExitBackButton(MainStats, true);
- SetMenuExitButton(MainStats, true);
- DisplayMenu(MainStats, client, MENU_TIME_FOREVER);
- }
- public int MainStatsMenu(Handle menu, MenuAction action, int client, int symbol)
- {
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayBankTo(int client)
- {
- Handle BankTo = CreateMenu(MenuBankTransfer);
- SetMenuTitle(BankTo, "Ваш вклад:");
- AddMenuItem(BankTo, "0", "10%");
- AddMenuItem(BankTo, "1", "20%");
- AddMenuItem(BankTo, "2", "30%");
- AddMenuItem(BankTo, "3", "40%");
- AddMenuItem(BankTo, "4", "50%");
- AddMenuItem(BankTo, "5", "60%");
- AddMenuItem(BankTo, "6", "70%");
- AddMenuItem(BankTo, "7", "80%");
- AddMenuItem(BankTo, "8", "90%");
- AddMenuItem(BankTo, "9", "100%");
- SetMenuExitBackButton(BankTo, true);
- SetMenuExitButton(BankTo, true);
- DisplayMenu(BankTo, client, MENU_TIME_FOREVER);
- }
- void DisplayShop(int client)
- {
- Handle Shop = CreateMenu(MenuShop);
- char sItemEx[96];
- Format(sItemEx, sizeof(sItemEx), "%t", "TitleOfMenuShop");
- SetMenuTitle(Shop, sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmo", GetConVarInt(CostExpAmmo));
- AddMenuItem(Shop, "0", sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmo", GetConVarInt(CostIncAmmo));
- AddMenuItem(Shop, "1", sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "ShopLaserSight", GetConVarInt(CostLaserSight));
- AddMenuItem(Shop, "2", sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "ShopExplosiveAmmoPack", GetConVarInt(CostExpAmmoPack));
- AddMenuItem(Shop, "3", sItemEx);
- Format(sItemEx, sizeof(sItemEx), "%t", "ShopIncendiaryAmmoPack", GetConVarInt(CostIncAmmoPack));
- AddMenuItem(Shop, "4", sItemEx);
- SetMenuExitBackButton(Shop, true);
- SetMenuExitButton(Shop, true);
- DisplayMenu(Shop, client, MENU_TIME_FOREVER);
- }
- public int MenuShop(Handle Shop, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(Shop);
- return;
- }
- switch(symbol)
- {
- case 0:
- {
- if(Cash[client] >= GetConVarInt(CostExpAmmo))
- {
- Cash[client] -= GetConVarInt(CostExpAmmo);
- GiveUpgrade(client, 1);
- Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
- }
- }
- case 1:
- {
- if(Cash[client] >= GetConVarInt(CostIncAmmo))
- {
- Cash[client] -= GetConVarInt(CostIncAmmo);
- GiveUpgrade(client, 2);
- Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
- }
- }
- case 2:
- {
- if(Cash[client] >= GetConVarInt(CostLaserSight))
- {
- Cash[client] -= GetConVarInt(CostLaserSight);
- GiveUpgrade(client, 3);
- Client_PrintToChat(client, true, "%t", "BoughtLaserSight");
- }
- }
- case 3:
- {
- if(Cash[client] >= GetConVarInt(CostExpAmmoPack))
- {
- Cash[client] -= GetConVarInt(CostExpAmmoPack);
- GiveFunction(client, "upgradepack_explosive");
- Client_PrintToChat(client, true, "%t", "BoughtExpAmmo");
- }
- }
- case 4:
- {
- if(Cash[client] >= GetConVarInt(CostIncAmmoPack))
- {
- Cash[client] -= GetConVarInt(CostIncAmmoPack);
- GiveFunction(client, "upgradepack_incendiary");
- Client_PrintToChat(client, true, "%t", "BoughtIncAmmo");
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- public int MenuBankTransfer(Handle TransferMenu, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(TransferMenu);
- return;
- }
- int TrasferCash = Cash[client];
- int NumCash = 0;
- int Procents = 0;
- if(bIsSurvivor(client))
- {
- symbol += 1;
- NumCash = RoundToCeil(TrasferCash * (0.1 * symbol));
- Cash[client] -= NumCash;
- TeamCash += NumCash;
- Procents = 10 * (symbol + 1);
- Client_PrintToChat(client, true, "%t", "ProcentsInBank", NumCash, Procents);
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void DisplayTeamHelp(int client)
- {
- Handle TeamUp = CreateMenu(MenuTeamUpgrade);
- char sStringEx[64];
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradesTitle");
- SetMenuTitle(TeamUp, sStringEx);
- if(vHealUpTeam == null)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
- AddMenuItem(TeamUp, "0", sStringEx);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeRegeneration");
- AddMenuItem(TeamUp, "0", sStringEx, ITEMDRAW_DISABLED);
- }
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeKillAllCommons");
- AddMenuItem(TeamUp, "1", sStringEx);
- if(vPoisonTeam != null)
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
- AddMenuItem(TeamUp, "2", sStringEx, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradePoisonForSpecialInfected");
- AddMenuItem(TeamUp, "2", sStringEx);
- }
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeIgniteAssForAllSpecials");
- AddMenuItem(TeamUp, "3", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeHealAllSurvivorFor50Hp");
- AddMenuItem(TeamUp, "4", sStringEx);
- Format(sStringEx, sizeof(sStringEx), "%t", "TeamUpgradeBuyAmmoForAllSurvivors");
- AddMenuItem(TeamUp, "5", sStringEx);
- SetMenuExitBackButton(TeamUp, true);
- SetMenuExitButton(TeamUp, true);
- DisplayMenu(TeamUp, client, MENU_TIME_FOREVER);
- }
- public int MenuTeamUpgrade(Handle TeamUpgradeMenu, MenuAction action, int client, int symbol)
- {
- if (action == MenuAction_End)
- {
- CloseHandle(TeamUpgradeMenu);
- return;
- }
- if(bIsSurvivor(client))
- {
- switch(symbol)
- {
- case 0:
- {
- if(TeamCash >= 50000)
- {
- vHealUpTeam = CreateTimer(2.0, vTeamHealUp, _, TIMER_REPEAT);
- //TeamHeal = true;
- TeamCash -= 50000;
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t", "ChatWhoBoughtRegeneration", client);
- //Client_PrintToChat(i, true, "{B}%N {R}купил регенерацию хп для выживших.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t", "YouBuyRegeneration");
- //Client_PrintToChat(i, true, "{B}Вы {R}купили регенерацию хп.");
- }
- }
- }
- }
- }
- case 1:
- {
- if(TeamCash >= 30000)
- {
- TeamCash -= 30000;
- for(int i = 33; i <= 2048; ++i)
- {
- if(IsCommonInfected(i))
- {
- ForceDamageEntity(client, 1000, i);
- }
- }
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t", "WhoKilledAllCommonForTeamCash", client);
- //Client_PrintToChat(i, true, "{B}%N {R}убил всех мобов за командные очки.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t", "YouKilledAllCommonsForTeamCash");
- }
- }
- }
- }
- }
- case 2:
- {
- if(TeamCash >= 30000)
- {
- vPoisonTeam = CreateTimer(2.0, vTeamPoison, client, TIMER_REPEAT);
- CreateTimer(30.0, vTeamPoisonKill);
- TeamCash -= 30000;
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "WhoPoisonedInf", client);
- //Client_PrintToChat(i, true, "{B}%N {R}отравил заражённых за командные очки.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "YouPoisonedInf", client);
- Client_PrintToChat(i, true, "{B}Вы {R}отравили заражённых.");
- }
- }
- }
- }
- }
- case 3:
- {
- if(TeamCash >= 10000)
- {
- TeamCash -= 10000;
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "WhoIgnitedTheHearts", client);
- //Client_PrintToChat(i, true, "{B}%N {R}поджог пукан заражённых.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "YouIgnitedTheHearts", client);
- Client_PrintToChat(i, true, "{B}Вы {R}воспламенили очаг.");
- }
- }
- if(IsValidInfected(i))
- {
- float vPos[3];
- GetClientAbsOrigin(i, vPos);
- LittleFlower(vPos, 0);
- LittleFlower(vPos, 1);
- }
- }
- }
- }
- case 4:
- {
- if(TeamCash >= 15000)
- {
- TeamCash -= 15000;
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "WhoHealedSurvivors", client);
- //Client_PrintToChat(i, true, "{B}%N {R}вылечил всех на 50 хп за командные очки.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "YouHealedSurvivors");
- //Client_PrintToChat(i, true, "{B}Вы {R}полечили всех выживших.");
- }
- }
- if(bIsSurvivor(i) && !IsPlayerIncaped(i))
- {
- int vHeal = GetClientHealth(i);
- float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
- if(vHeal + 50 + RoundToCeil(vHealthBuffer) > 100 || vHeal > 100 || vHealthBuffer > 100 || vHeal + vHealthBuffer > 100)
- {
- SetEntityHealth(i, 100);
- SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
- }
- else if(RoundToCeil(vHeal + vHealthBuffer) < 100)
- {
- float vForward = vHeal - vHealthBuffer;
- if(vForward < 0)
- {
- SetEntityHealth(i, vHeal + 50);
- SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
- }
- else
- {
- float vTransitPoint = 50 - vHealthBuffer;
- SetEntityHealth(i, RoundToCeil(vHeal + vTransitPoint));
- SetEntPropFloat(client, Prop_Send, "m_healthBuffer", vHealthBuffer - vTransitPoint);
- }
- }
- }
- }
- }
- }
- case 5:
- {
- if(TeamCash >= 3000)
- {
- TeamCash -= 3000;
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(client != i)
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "WhoBuyAmmo", client);
- //Client_PrintToChat(i, true, "{B}%N {R}купил всем патроны за командные очки.", client);
- }
- }
- else
- {
- if(IsInGame(i))
- {
- Client_PrintToChat(i, true, "%t.", "YouBuyAmmo");
- //Client_PrintToChat(i, true, "{B}Вы {R}купили патроны всем выжившим.");
- }
- }
- if(bIsSurvivor(i))
- {
- GiveFunction(i, "ammo");
- }
- }
- }
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- public Action vTeamHealUp(Handle timer)
- {
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(bIsSurvivor(i) && !IsPlayerIncaped(i))
- {
- int iHeal = GetClientHealth(i);
- float vHealthBuffer = GetEntPropFloat(i, Prop_Send, "m_healthBuffer");
- if(RoundToCeil(vHealthBuffer) > 0 && iHeal < 100)
- {
- SetEntityHealth(i, iHeal + 1);
- SetEntPropFloat(i, Prop_Send, "m_healthBuffer", vHealthBuffer - 1);
- }
- else if(iHeal < 100 && vHealthBuffer < 1)
- {
- SetEntityHealth(i, iHeal + 1);
- }
- }
- }
- }
- public Action vTeamPoison(Handle timer, int client)
- {
- for(int i = 1; i <= MaxClients; ++i)
- {
- if(IsValidInfected(i))
- {
- ForceDamageEntity(client, 25, i);
- }
- }
- }
- public Action vTeamPoisonKill(Handle timer)
- {
- KillTimer(vPoisonTeam);
- vPoisonTeam = null;
- }
- void DisplayTransfer(int client)
- {
- Handle MainTransfer = CreateMenu(MenuTrasnfer);
- char sStringEx[32];
- Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransferPlayersList");
- SetMenuTitle(MainTransfer, sStringEx);
- char userid[15];
- char name[32];
- for (int i = 1; i <= MaxClients; i++)
- {
- if (bIsSurvivor(i) && !IsFakeClient(i) && client != i)
- {
- IntToString(GetClientUserId(i), userid, 15);
- GetClientName(i, name, 32);
- AddMenuItem(MainTransfer, userid, name);
- }
- }
- SetMenuExitBackButton(MainTransfer, true);
- SetMenuExitButton(MainTransfer, true);
- DisplayMenu(MainTransfer, client, MENU_TIME_FOREVER);
- }
- void DisplayTransferSecondPart(int client)
- {
- Handle MainTransferSecond = CreateMenu(MenuTrasnferSecond);
- char sStringEx[32];
- Format(sStringEx, sizeof(sStringEx), "%t", "MenuTitleOfTransfer");
- SetMenuTitle(MainTransferSecond, sStringEx);
- AddMenuItem(MainTransferSecond, "0", "10%");
- AddMenuItem(MainTransferSecond, "1", "20%");
- AddMenuItem(MainTransferSecond, "2", "30%");
- AddMenuItem(MainTransferSecond, "3", "40%");
- AddMenuItem(MainTransferSecond, "4", "50%");
- AddMenuItem(MainTransferSecond, "5", "60%");
- AddMenuItem(MainTransferSecond, "6", "70%");
- AddMenuItem(MainTransferSecond, "7", "80%");
- AddMenuItem(MainTransferSecond, "8", "90%");
- AddMenuItem(MainTransferSecond, "9", "100%");
- SetMenuExitBackButton(MainTransferSecond, true);
- SetMenuExitButton(MainTransferSecond, true);
- DisplayMenu(MainTransferSecond, client, MENU_TIME_FOREVER);
- }
- public int MenuTrasnferSecond(Handle MenuTrasnferCallback, MenuAction action, int client, int symbol)
- {
- if(bIsSurvivor(client))
- {
- if (action == MenuAction_End)
- {
- CloseHandle(MenuTrasnferCallback);
- return;
- }
- int TrasferCash = Cash[client];
- int Victim = Target[client];
- int NumCash = 0;
- int Percents = 0;
- symbol += 1;
- NumCash = RoundToCeil(TrasferCash * (0.1 * symbol));
- Cash[client] -= NumCash;
- Cash[Victim] += NumCash;
- Percents = 10 * symbol;
- Client_PrintToChat(client, true, "%t", "YouGaveTheTeammate", Victim, NumCash, Percents);
- Client_PrintToChat(Victim, true, "%t", "YouReceivedFromTeammate", client, NumCash, Percents);
- }
- if(action == MenuAction_Cancel)
- {
- if(symbol == MenuCancel_ExitBack)
- {
- DisplayTransfer(client);
- }
- }
- }
- public int MenuTrasnfer(Handle CallBackTransfer, MenuAction action, int client, int option)
- {
- if(bIsSurvivor(client))
- {
- if (action == MenuAction_End)
- {
- CloseHandle(CallBackTransfer);
- return;
- }
- char userid[15];
- GetMenuItem(CallBackTransfer, option, userid, 15);
- int target = GetClientOfUserId(StringToInt(userid));
- if (bIsSurvivor(target))
- {
- DisplayTransferSecondPart(client);
- Target[client] = target;
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(option == MenuCancel_ExitBack)
- {
- DisplayMainMenu(client);
- }
- }
- }
- void SetArrayValues()
- {
- g_iArrayCostList[Index_AntiDamage] = GetConVarInt(CostAntiDamage);
- g_iArrayCostList[Index_Molotov] = GetConVarInt(CostEpicMoli);
- g_iArrayCostList[Index_FastReload] = GetConVarInt(CostFastReload);
- g_iArrayCostList[Index_HelpingHand] = GetConVarInt(CostHelpingHand);
- g_iArrayCostList[Index_MeleeDamage] = GetConVarInt(CostMeleeDamage);
- g_iArrayCostList[Index_PerfectShove] = GetConVarInt(CostShoveDamage);
- g_iArrayCostList[Index_StickyPipe] = GetConVarInt(CostPipeIndixite);
- g_iArrayCostList[Index_SpeedUp] = GetConVarInt(CostSpeedUp);
- g_iArrayCostList[Index_PipeBomBUltra] = GetConVarInt(CostUltraPipe);
- g_iArrayCostList[Index_DoubleJump] = GetConVarInt(CostDoubleJump);
- g_iArrayCostList[Index_Crafting] = GetConVarInt(CostMinecraft);
- }
- void ResetAllPerks()
- {
- for (int i = 1; i <= MaxClients; i++)
- {
- for (int j = 0; j <= 11; j++)
- {
- g_GlobalEnabledBool[i][j] = false;
- }
- }
- }
- public void SetArray()
- {
- g_iArrayCostList[Index_AntiDamage] = GetConVarInt(CostAntiDamage);
- g_iArrayCostList[Index_Molotov] = GetConVarInt(CostEpicMoli);
- g_iArrayCostList[Index_FastReload] = GetConVarInt(CostFastReload);
- g_iArrayCostList[Index_HelpingHand] = GetConVarInt(CostHelpingHand);
- g_iArrayCostList[Index_MeleeDamage] = GetConVarInt(CostMeleeDamage);
- g_iArrayCostList[Index_PerfectShove] = GetConVarInt(CostShoveDamage);
- g_iArrayCostList[Index_StickyPipe] = GetConVarInt(CostPipeIndixite);
- g_iArrayCostList[Index_SpeedUp] = GetConVarInt(CostSpeedUp);
- g_iArrayCostList[Index_PipeBomBUltra] = GetConVarInt(CostUltraPipe);
- g_iArrayCostList[Index_DoubleJump] = GetConVarInt(CostDoubleJump);
- g_iArrayCostList[Index_Crafting] = GetConVarInt(CostMinecraft);
- }
Advertisement
Add Comment
Please, Sign In to add comment