Advertisement
OneShot1984

Dayz init.c / Spawn with certain items

Jul 2nd, 2023 (edited)
1,911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.93 KB | None | 0 0
  1.  
  2.  
  3.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  4.     {
  5.         EntityAI itemTop;
  6.         EntityAI itemEnt;
  7.         ItemBase itemBs;
  8.         EntityAI itemClothing;
  9.         float rand;
  10.  
  11.      player.RemoveAllItems();
  12.    
  13.     ref TStringArray topsArray = {"tacticalshirt_LiveToSurvive"};
  14.     ref TStringArray pantsArray = {"cargopants_LiveToSurvive"};
  15.     ref TStringArray shoesArray = {"jungleboots_LiveToSurvive"};
  16.     ref TStringArray backpackArray = {"TaloonBag_LiveToSurvive"};
  17.     ref TStringArray helmArray = {"BaseballCap_LiveToSurvive"};
  18.     ref TStringArray handsArray = {"tacticalgloves_LiveToSurvive"};
  19.  
  20.  
  21.     EntityAI item1 = player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
  22.     EntityAI item2 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
  23.     EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
  24.     EntityAI item4 = player.GetInventory().CreateInInventory(backpackArray.GetRandomElement());
  25.     EntityAI item5 = player.GetInventory().CreateInInventory(helmArray.GetRandomElement());
  26.     EntityAI item7 = player.GetInventory().CreateInInventory(handsArray.GetRandomElement());    
  27.  
  28.    
  29.  
  30.         itemClothing = player.FindAttachmentBySlotName( "Body" );
  31.         {
  32.  
  33.              itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  34.         player.SetQuickBarEntityShortcut(itemEnt, 3);
  35.        
  36.            
  37.             itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  38.  
  39.             itemEnt = player.GetInventory().CreateInInventory("BandageDressing");
  40.             player.SetQuickBarEntityShortcut(itemEnt, 2);
  41.  
  42.             itemEnt = player.GetInventory().CreateInInventory("BakedBeansCan_Opened");
  43.             player.SetQuickBarEntityShortcut(itemEnt, 4);
  44.  
  45.             itemEnt = player.GetInventory().CreateInInventory("BakedBeansCan_Opened");
  46.  
  47.  
  48.             itemEnt = player.GetInventory().CreateInInventory("CombatKnife");
  49.             player.SetQuickBarEntityShortcut(itemEnt, 0);
  50.  
  51.            
  52.             itemEnt = player.GetInventory().CreateInInventory("Roadflare");
  53.             player.SetQuickBarEntityShortcut(itemEnt, 1);
  54.        
  55.          
  56.             };
  57.         if ( itemClothing )
  58.         {
  59.             //SetRandomHealth( itemClothing );
  60.            
  61.             //itemEnt = itemClothing.GetInventory().CreateInInventory( "TunaCan" );
  62.                         if ( Class.CastTo( itemBs, itemEnt ) )
  63.                 itemBs.SetQuantity( 4 );
  64.  
  65.             //SetRandomHealth( itemEnt );
  66.  
  67.             string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
  68.             int rndIndex = Math.RandomInt( 0, 4 );
  69.             //itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
  70.             SetRandomHealth( itemEnt );
  71.         }
  72.        
  73.         itemClothing = player.FindAttachmentBySlotName( "legs" );
  74.         if ( itemClothing )
  75.             //SetRandomHealth( itemClothing );
  76.        
  77.         itemClothing = player.FindAttachmentBySlotName( "Feet" );
  78.         if ( itemClothing )
  79.             //SetRandomHealth( itemClothing );
  80.  
  81.     }
  82. };
  83. Mission CreateCustomMission(string path)
  84. {
  85.     return new CustomMission();
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement