Advertisement
iKurdo

init.c 3Ramdom loadouts

Feb 3rd, 2023 (edited)
923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.05 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. }
  32.  
  33. class CustomMission: MissionServer
  34. {
  35.     override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  36.     {
  37.         Entity playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");
  38.         Class.CastTo(m_player, playerEnt);
  39.         GetGame().SelectPlayer(identity, m_player);
  40.  
  41.         return m_player;
  42.     }
  43.  
  44.     void addMags(PlayerBase player, string mag_type, int count)
  45.     {
  46.         if (count < 1)
  47.         return;
  48.         EntityAI mag;
  49.         for (int i = 0; i < count; i++)
  50.         {
  51.             mag = player.GetInventory().CreateInInventory(mag_type);
  52.         }
  53.  
  54.         player.SetQuickBarEntityShortcut(mag, 1, true);
  55.     }
  56.  
  57.     EntityAI assaultClass(PlayerBase player)
  58.     {
  59.         EntityAI gun = player.GetHumanInventory().CreateInHands("M4A1");
  60.         gun.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
  61.         gun.GetInventory().CreateAttachment("M4_MPBttstck_Black");
  62.         gun.GetInventory().CreateAttachment("ACOGOptic");
  63.         addMags(player, "Mag_STANAG_30Rnd", 3);
  64.  
  65.         return gun;
  66.     }
  67.  
  68.     EntityAI sniperClass(PlayerBase player)
  69.     {
  70.         EntityAI gun = player.GetHumanInventory().CreateInHands("SVD");
  71.         gun.GetInventory().CreateAttachment("PSO1Optic");
  72.         addMags(player, "Mag_SVD_10Rnd", 3);
  73.  
  74.         return gun;
  75.     }
  76.  
  77.     EntityAI smgClass(PlayerBase player)
  78.     {
  79.         EntityAI gun = player.GetHumanInventory().CreateInHands("UMP45");
  80.         gun.GetInventory().CreateAttachment("PistolSuppressor");
  81.         addMags(player, "Mag_UMP_25Rnd", 3);
  82.  
  83.         return gun;
  84.     }
  85.  
  86.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  87.     {
  88.         player.RemoveAllItems();
  89.        
  90.         player.GetInventory().CreateInInventory("UKAssVest_Camo");
  91.         player.GetInventory().CreateInInventory("AssaultBag_Green");
  92.         player.GetInventory().CreateInInventory("TTSKOPants");
  93.         player.GetInventory().CreateInInventory("TTsKOJacket_Camo");
  94.         player.GetInventory().CreateInInventory("CombatBoots_Black");
  95.         player.GetInventory().CreateInInventory("BoonieHat_Flecktran");
  96.         player.GetInventory().CreateInInventory("TacticalGloves_Black");
  97.         player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  98.         player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  99.         player.GetInventory().CreateInInventory("SpaghettiCan");
  100.         player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
  101.         player.GetInventory().CreateInInventory("HuntingKnife");
  102.         player.GetInventory().CreateInInventory("OrienteeringCompass");
  103.         player.GetInventory().CreateInInventory("TacticalBaconCan_Opened");
  104.         player.GetInventory().CreateInInventory("TetracyclineAntibiotics");
  105.         player.GetInventory().CreateInInventory("AntiChemInjector");
  106.         player.GetInventory().CreateInInventory("BandageDressing");
  107.         ItemBase rags = player.GetInventory().CreateInInventory("Rag");
  108.         rags.SetQuantity(4);
  109.  
  110.         EntityAI primary;
  111.         EntityAI axe = player.GetInventory().CreateInInventory("FirefighterAxe");
  112.  
  113.         switch (Math.RandomInt(0, 3)) {
  114.             case 0: primary = assaultClass(player); break;
  115.             case 1: primary = sniperClass(player); break;
  116.             case 2: primary = smgClass(player); break;
  117.         }
  118.  
  119.         player.LocalTakeEntityToHands(primary);
  120.         player.SetQuickBarEntityShortcut(primary, 0, true);
  121.         player.SetQuickBarEntityShortcut(rags, 2, true);
  122.         player.SetQuickBarEntityShortcut(axe, 3, true);
  123.     }
  124. };
  125.  
  126. Mission CreateCustomMission(string path)
  127. {
  128.     return new CustomMission();
  129. }
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement