Advertisement
iKurdo

Init_VIP.c

May 15th, 2020 (edited)
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 17.46 KB | Gaming | 0 0
  1. void main()
  2. {
  3.     //INIT ECONOMY--------------------------------------
  4.     Hive ce = CreateHive();
  5.     if ( ce )
  6.         ce.InitOffline();
  7.  
  8.     //DATE RESET AFTER ECONOMY INIT-------------------------
  9.     int year, month, day, hour, minute;
  10.     int reset_month = 9, reset_day = 20;
  11.     GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  12.  
  13.     if ((month == reset_month) && (day < reset_day))
  14.     {
  15.         GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  16.     }
  17.     else
  18.     {
  19.         if ((month == reset_month + 1) && (day > reset_day))
  20.         {
  21.             GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  22.         }
  23.         else
  24.         {
  25.             if ((month < reset_month) || (month > reset_month + 1))
  26.             {
  27.                 GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  28.             }
  29.         }
  30.     }
  31.     //EditorLoaderModule.ExportLootData = true;
  32. }
  33.  
  34. class CustomMission: MissionServer
  35. {
  36.     void SetRandomHealth(EntityAI itemEnt)
  37.     {
  38.         if ( itemEnt )
  39.         {
  40.             float rndHlt = Math.RandomFloat( 0.45, 0.65 );
  41.             itemEnt.SetHealth01( "", "", rndHlt );
  42.         }
  43.     }
  44.  
  45.     override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  46.     {
  47.         Entity playerEnt;
  48.         playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
  49.         Class.CastTo( m_player, playerEnt );
  50.  
  51.         GetGame().SelectPlayer( identity, m_player );
  52.  
  53.         return m_player;
  54.     }
  55.  
  56.     ref TStringArray admins = {"76561198205607135","76561199156853297","76561198074995392"};   
  57.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  58.     {
  59.         EntityAI itemClothing;
  60.         EntityAI itemEnt;
  61.         ItemBase itemBs;
  62.         float rand;
  63.         player.RemoveAllItems();       
  64.         for ( int i = 0; i < admins.Count(); ++i ) 
  65.         if (player.GetIdentity().GetPlainId() == admins[i])
  66.         {
  67.             player.RemoveAllItems();           
  68.  
  69.             player.GetInventory().CreateAttachment("NVGHeadstrap").GetInventory().CreateAttachment("NVGoggles").GetInventory().CreateAttachment("Battery9V");
  70.             player.GetInventory().CreateAttachment("BoonieHat_DPM").GetInventory().CreateAttachment("Bait");
  71.             player.GetInventory().CreateAttachment("Balaclava3Holes_Green");
  72.  
  73.             EntityAI A1Top = player.GetInventory().CreateAttachment("M65Jacket_Olive");
  74.             A1Top.GetInventory().CreateInInventory("BandageDressing");
  75.             A1Top.GetInventory().CreateInInventory("BandageDressing");
  76.             A1Top.GetInventory().CreateInInventory("CanOpener");
  77.             A1Top.GetInventory().CreateInInventory("Matchbox");
  78.             A1Top.GetInventory().CreateInInventory("Lockpick");
  79.             A1Top.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
  80.             A1Top.GetInventory().CreateInInventory("TacticalBaconCan");
  81.             A1Top.GetInventory().CreateInInventory("Whetstone");
  82.             A1Top.GetInventory().CreateInInventory("SewingKit");
  83.  
  84.             player.GetInventory().CreateAttachment("Armband_Bohemia");
  85.             player.GetInventory().CreateAttachment("TacticalGloves_Green");
  86.  
  87.             EntityAI PrimVest = player.GetInventory().CreateAttachment("PlateCarrierVest_Camo");
  88.             PrimVest.GetInventory().CreateAttachment("Grenade_ChemGas");
  89.             PrimVest.GetInventory().CreateAttachment("M18SmokeGrenade_White");
  90.             PrimVest.GetInventory().CreateAttachment("M67Grenade");
  91.             PrimVest.GetInventory().CreateAttachment("FlashGrenade");
  92.            
  93.             EntityAI Pouches = PrimVest.GetInventory().CreateAttachment("PlateCarrierPouches_Camo");
  94.             EntityAI Mag0 = Pouches.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");
  95.             Pouches.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");
  96.             Pouches.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");
  97.             EntityAI MagD0 = Pouches.GetInventory().CreateInInventory("Mag_MKII_9rnd");
  98.             Pouches.GetInventory().CreateInInventory("Mag_MKII_9rnd");
  99.             Pouches.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
  100.             Pouches.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
  101.             Pouches.GetInventory().CreateInInventory("Mag_SVD_10Rnd");
  102.            
  103.             EntityAI Holst0 = PrimVest.GetInventory().CreateAttachment("PlateCarrierHolster_Camo");
  104.             EntityAI Gold0 = Holst0.GetInventory().CreateAttachment("MKII_Gold");
  105.  
  106.             EntityAI PrimBelt = player.GetInventory().CreateAttachment("MilitaryBelt");
  107.             EntityAI Cant0 = PrimBelt.GetInventory().CreateAttachment("Canteen");
  108.             EntityAI PrimNylon = PrimBelt.GetInventory().CreateAttachment("NylonKnifeSheath");
  109.             PrimNylon.GetInventory().CreateInInventory("CombatKnife")
  110.             EntityAI Holst00 = PrimBelt.GetInventory().CreateAttachment("PlateCarrierHolster_Camo");
  111.             Holst00.GetInventory().CreateAttachment("Magnum");
  112.  
  113.             EntityAI PrimPant = player.GetInventory().CreateAttachment("USMCPants_Woodland");
  114.             EntityAI Rod0 = PrimPant.GetInventory().CreateInInventory("FishingRod").GetInventory().CreateAttachment("Bait");
  115.  
  116.             player.GetInventory().CreateAttachment("MilitaryBoots_Black").GetInventory().CreateAttachment("FangeKnife");       
  117.  
  118.             EntityAI PrimBag = player.GetInventory().CreateAttachment("AliceBag_Camo");
  119.             EntityAI PrimRadio = PrimBag.GetInventory().CreateAttachment("GPSReceiver").GetInventory().CreateAttachment("Battery9V");
  120.             EntityAI PrimAbox = PrimBag.GetInventory().CreateInInventory("AmmoBox");
  121.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  122.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  123.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  124.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  125.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  126.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_357_20Rnd");
  127.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_357_20Rnd");
  128.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_357_20Rnd");
  129.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_357_20Rnd");
  130.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_357_20Rnd");
  131.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
  132.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
  133.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
  134.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
  135.             PrimAbox.GetInventory().CreateInInventory("AmmoBox_762x54_20Rnd");
  136.             PrimBag.GetInventory().CreateAttachment("Chemlight_Green");
  137.             EntityAI Axe0 = PrimBag.GetInventory().CreateInInventory("FirefighterAxe_Green");
  138.  
  139.             EntityAI FirstA0 = PrimBag.GetInventory().CreateInInventory("FirstAidKit");
  140.             FirstA0.GetInventory().CreateInInventory("VitaminBottle");
  141.             FirstA0.GetInventory().CreateInInventory("TetracyclineAntibiotics");
  142.             FirstA0.GetInventory().CreateInInventory("PurificationTablets");
  143.             FirstA0.GetInventory().CreateInInventory("BloodTestKit");
  144.             EntityAI FirstA00 = PrimBag.GetInventory().CreateInInventory("FirstAidKit");
  145.             FirstA00.GetInventory().CreateInInventory("Epinephrine");
  146.             FirstA00.GetInventory().CreateInInventory("Morphine");
  147.             FirstA00.GetInventory().CreateInInventory("AntiChemInjector");
  148.             FirstA00.GetInventory().CreateInInventory("BloodTestKit");
  149.  
  150.             EntityAI PrimGun0 = player.GetHumanInventory().CreateInHands("M4A1");
  151.             PrimGun0.GetInventory().CreateAttachment("M4_RISHndgrd");
  152.             PrimGun0.GetInventory().CreateAttachment("M4_CQBBttstck");
  153.             PrimGun0.GetInventory().CreateAttachment("M4_Suppressor");
  154.             PrimGun0.GetInventory().CreateAttachment("ACOGOptic");
  155.             PrimGun0.GetInventory().CreateAttachment("UniversalLight").GetInventory().CreateAttachment("Battery9V");
  156.  
  157.             EntityAI PrimGun00 = player.GetHumanInventory().CreateAttachment("SVD");
  158.             PrimGun00.GetInventory().CreateAttachment("AK_Suppressor");
  159.             PrimGun00.GetInventory().CreateAttachment("PSO1Optic").GetInventory().CreateAttachment("Battery9V");
  160.  
  161.             player.SetQuickBarEntityShortcut(PrimGun0, 0, true);
  162.             player.SetQuickBarEntityShortcut(Mag0, 1, true);
  163.             player.SetQuickBarEntityShortcut(Gold0, 2, true);
  164.             player.SetQuickBarEntityShortcut(MagD0, 3, true);
  165.             player.SetQuickBarEntityShortcut(Axe0, 4, true);
  166.             player.SetQuickBarEntityShortcut(PrimAbox, 5, true);
  167.             player.SetQuickBarEntityShortcut(FirstA0, 6, true);
  168.  
  169.             rand = Math.RandomFloatInclusive(0.0, 1.0);
  170.             if ( rand < 0.25 )
  171.             itemEnt = player.GetInventory().CreateInInventory("SodaCan_Cola");
  172.             else if ( rand > 0.75 )
  173.             itemEnt = player.GetInventory().CreateInInventory("SodaCan_Spite");
  174.             else
  175.             itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  176.  
  177.             SetRandomHealth(itemEnt);
  178.  
  179.             rand = Math.RandomFloatInclusive(0.0, 1.0);
  180.             if ( rand < 0.35 )
  181.             itemEnt = player.GetInventory().CreateInInventory("Apple");
  182.             else if ( rand > 0.65 )
  183.             itemEnt = player.GetInventory().CreateInInventory("Pear");
  184.             else
  185.             itemEnt = player.GetInventory().CreateInInventory("Plum");        
  186.             player.GetStatWater().Set( 900 );
  187.             player.GetStatEnergy().Set( 1100 );
  188.         }
  189.         switch (Math.RandomInt(0, 9))
  190.         {
  191.             // -------------- Soldier -------------
  192.             case 0:
  193.             EntityAI Top0 = player.GetInventory().CreateAttachment("TShirt_Green");
  194.             player.GetInventory().CreateAttachment("TTSKOPants");
  195.             player.GetInventory().CreateAttachment("MilitaryBoots_Black");
  196.             Top0.GetInventory().CreateInInventory("TacticalBaconCan");
  197.             Top0.GetInventory().CreateInInventory("BandageDressing");
  198.             EntityAI WB0 = Top0.GetInventory().CreateInInventory("WaterBottle");
  199.             player.GetInventory().CreateInInventory("CombatKnife");
  200.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  201.             EntityAI kn = player.GetHumanInventory().CreateInHands("MKII");
  202.                 player.SetQuickBarEntityShortcut(kn, 0, true);
  203.                 player.SetQuickBarEntityShortcut(WB0, 1, true);
  204.             break;
  205.             // -------------- Paramedic -------------
  206.             case 1:
  207.             EntityAI Top1 = player.GetInventory().CreateAttachment("ParamedicJacket_Green");
  208.             player.GetInventory().CreateAttachment("SurgicalMask");
  209.             player.GetInventory().CreateAttachment("SurgicalGloves_Green");
  210.             player.GetInventory().CreateAttachment("ParamedicPants_Green");
  211.             Top1.GetInventory().CreateInInventory("SalineBagIV");
  212.             Top1.GetInventory().CreateInInventory("BandageDressing");
  213.             player.GetInventory().CreateAttachment("AthleticShoes_Green");
  214.             EntityAI WB1 = Top1.GetInventory().CreateInInventory("WaterBottle");
  215.             player.GetInventory().CreateInInventory("SteakKnife");
  216.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  217.             EntityAI kn1 = player.GetHumanInventory().CreateInHands("MKII");
  218.                 player.SetQuickBarEntityShortcut(kn1, 0, true);
  219.                 player.SetQuickBarEntityShortcut(WB1, 1, true);
  220.             break;
  221.             // -------------- Office worker -------------
  222.             case 2:
  223.             EntityAI Top2 = player.GetInventory().CreateAttachment("ManSuit_Black");
  224.             player.GetInventory().CreateAttachment("SlacksPants_Black");
  225.             player.GetInventory().CreateAttachment("DressShoes_Black");
  226.             Top2.GetInventory().CreateInInventory("SodaCan_Cola");
  227.             Top2.GetInventory().CreateInInventory("TunaCan");
  228.             player.GetInventory().CreateAttachment("ThinFramesGlasses");
  229.             Top2.GetInventory().CreateInInventory("BandageDressing");
  230.             EntityAI WB2 = Top2.GetInventory().CreateInInventory("WaterBottle");
  231.             player.GetInventory().CreateInInventory("KitchenKnife");
  232.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  233.             EntityAI kn2 = player.GetHumanInventory().CreateInHands("MKII");
  234.                 player.SetQuickBarEntityShortcut(kn2, 0, true);
  235.                 player.SetQuickBarEntityShortcut(WB2, 1, true);
  236.             break;
  237.             // -------------- Biker -------------
  238.             case 3:
  239.             EntityAI Top3 = player.GetInventory().CreateAttachment("RidersJacket_Black");
  240.             player.GetInventory().CreateAttachment("Jeans_Black");
  241.             player.GetInventory().CreateAttachment("MotoHelmet_Red");
  242.             player.GetInventory().CreateAttachment("HikingBootsLow_Black");
  243.             Top3.GetInventory().CreateInInventory("Matchbox");
  244.             Top3.GetInventory().CreateInInventory("KitchenKnife");
  245.             Top3.GetInventory().CreateInInventory("BandageDressing");
  246.             EntityAI WB3 = Top3.GetInventory().CreateInInventory("WaterBottle");
  247.             player.GetInventory().CreateInInventory("NailedBaseballBat");
  248.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  249.             EntityAI kn3 = player.GetHumanInventory().CreateInHands("MKII");
  250.                 player.SetQuickBarEntityShortcut(kn3, 0, true);
  251.                 player.SetQuickBarEntityShortcut(WB3, 1, true);
  252.             break;
  253.             // -------------- Hiker -------------
  254.             case 4:
  255.             EntityAI Top4 = player.GetInventory().CreateAttachment("HikingJacket_Red");
  256.             player.GetInventory().CreateAttachment("Ushanka_Black");
  257.             player.GetInventory().CreateAttachment("AthleticShoes_Blue");
  258.             player.GetInventory().CreateAttachment("CargoPants_Blue");
  259.             player.GetInventory().CreateAttachment("CivilianBelt");
  260.             Top4.GetInventory().CreateInInventory("Heatpack");
  261.             Top4.GetInventory().CreateInInventory("BandageDressing");
  262.             EntityAI WB4 = Top4.GetInventory().CreateInInventory("WaterBottle");
  263.             player.GetInventory().CreateInInventory("KitchenKnife");
  264.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  265.             EntityAI kn4 = player.GetHumanInventory().CreateInHands("MKII");
  266.                 player.SetQuickBarEntityShortcut(kn4, 0, true);
  267.                 player.SetQuickBarEntityShortcut(WB4, 1, true);
  268.             break;
  269.             // -------------- Cop -------------
  270.             case 5:
  271.             EntityAI Top5 = player.GetInventory().CreateAttachment("PoliceJacket");
  272.             player.GetInventory().CreateAttachment("PoliceCap");
  273.             player.GetInventory().CreateAttachment("PolicePants");
  274.             player.GetInventory().CreateAttachment("CombatBoots_Grey");
  275.             Top5.GetInventory().CreateInInventory("Handcuffs");
  276.             Top5.GetInventory().CreateInInventory("HandcuffKeys");
  277.             Top5.GetInventory().CreateInInventory("PersonalRadio").GetInventory().CreateInInventory("Battery9V");
  278.             Top5.GetInventory().CreateInInventory("BandageDressing");
  279.             EntityAI WB5 = Top5.GetInventory().CreateInInventory("WaterBottle");
  280.             player.GetInventory().CreateInInventory("KitchenKnife");
  281.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  282.             EntityAI kn5 = player.GetHumanInventory().CreateInHands("MKII");
  283.                 player.SetQuickBarEntityShortcut(kn5, 0, true);
  284.                 player.SetQuickBarEntityShortcut(WB5, 1, true);
  285.             break;
  286.             // -------------- Lumberjack -------------
  287.             case 6:
  288.             EntityAI Top6 = player.GetInventory().CreateAttachment("Shirt_RedCheck");
  289.             player.GetInventory().CreateAttachment("Jeans_Blue");
  290.             player.GetInventory().CreateAttachment("WorkingBoots_Brown");
  291.             player.GetInventory().CreateAttachment("Ushanka_Green");
  292.             Top6.GetInventory().CreateInInventory("BandageDressing");
  293.             EntityAI WB6 = player.GetInventory().CreateInInventory("WaterBottle");
  294.             player.GetInventory().CreateInInventory("Hatchet");
  295.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  296.             EntityAI kn6 = player.GetHumanInventory().CreateInHands("MKII");
  297.                 player.SetQuickBarEntityShortcut(kn6, 0, true);
  298.                 player.SetQuickBarEntityShortcut(WB6, 1, true);
  299.             break; 
  300.             // -------------- Hood -------------
  301.             case 7:
  302.             EntityAI Top7 = player.GetInventory().CreateAttachment("TShirt_White");
  303.             player.GetInventory().CreateAttachment("Crowbar");
  304.             player.GetInventory().CreateAttachment("WorkingGloves_Black");
  305.             player.GetInventory().CreateAttachment("Balaclava3Holes_Black");
  306.             player.GetInventory().CreateAttachment("TrackSuitPants_Black");
  307.             player.GetInventory().CreateAttachment("AthleticShoes_Black");
  308.             Top7.GetInventory().CreateInInventory("BandageDressing");
  309.             EntityAI WB7 = Top7.GetInventory().CreateInInventory("WaterBottle");
  310.             player.GetInventory().CreateInInventory("KitchenKnife");
  311.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  312.             EntityAI kn7 = player.GetHumanInventory().CreateInHands("MKII");
  313.                 player.SetQuickBarEntityShortcut(kn7, 0, true);
  314.                 player.SetQuickBarEntityShortcut(WB7, 1, true);
  315.             break;
  316.             // -------------- Fireman -------------
  317.             case 8:
  318.             EntityAI Top8 = player.GetInventory().CreateAttachment("FirefighterJacket_Beige");
  319.             player.GetInventory().CreateAttachment("FirefightersPants_Beige");
  320.             player.GetInventory().CreateAttachment("FirefightersHelmet_White");
  321.             player.GetInventory().CreateAttachment("WorkingBoots_Yellow");
  322.             Top8.GetInventory().CreateInInventory("BandageDressing");
  323.             EntityAI WB8 = Top8.GetInventory().CreateInInventory("WaterBottle");
  324.             player.GetInventory().CreateInInventory("FirefighterAxe");
  325.             player.GetInventory().CreateInInventory("Mag_MKII_10Rnd");
  326.             EntityAI fa8 = player.GetHumanInventory().CreateInHands("MKII");
  327.                 player.SetQuickBarEntityShortcut(fa8, 0, true);
  328.                 player.SetQuickBarEntityShortcut(WB8, 1, true);
  329.             break;
  330.         }
  331.  
  332.         // ----- Loot Para Todos -------------
  333.         player.GetInventory().CreateInInventory("AmmoBox_22_50Rnd");
  334.         player.GetInventory().CreateInInventory("Pen_Blue");
  335.         player.GetInventory().CreateInInventory("BakedBeansCan_Opened");
  336.         player.GetInventory().CreateInInventory("TunaCan");
  337.  
  338.         string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
  339.         int rndIndex = Math.RandomInt(0, 4);
  340.         itemEnt = player.GetInventory().CreateInInventory(chemlightArray[rndIndex]);
  341.         SetRandomHealth(itemEnt);
  342.  
  343.         rand = Math.RandomFloatInclusive(0.0, 1.0);
  344.         if ( rand < 0.35 )
  345.             itemEnt = player.GetInventory().CreateInInventory("Apple");
  346.         else if ( rand > 0.65 )
  347.             itemEnt = player.GetInventory().CreateInInventory("Pear");
  348.         else
  349.             itemEnt = player.GetInventory().CreateInInventory("Plum");
  350.         SetRandomHealth(itemEnt);
  351.     }
  352. };
  353.  
  354. Mission CreateCustomMission(string path)
  355. {
  356.     return new CustomMission();
  357. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement