HasterPaster

Spawn a Sea Chest with stuff in it in DayZ

Apr 12th, 2020
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. void main()
  2. {
  3.     // The standard init.c code goes here...
  4.     //INIT WEATHER BEFORE ECONOMY INIT------------------------
  5.     //INIT ECONOMY--------------------------------------
  6.     //DATE RESET AFTER ECONOMY INIT-------------------------
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.     // Put the lines below at the bottom of the main() function in init.c
  15.     // Start of code placing a Sea Chest on a coordinate.
  16.     string myContainerName = "SeaChest";
  17.     vector myContainerPosition = "12124.1 140.0012 12514.9";
  18.     vector myContainerOrientation = "0 0 0";
  19.    
  20.     EntityAI myContainer = EntityAI.Cast(GetGame().CreateObject(myContainerName, myContainerPosition));
  21.     myContainer.SetOrientation(myContainerOrientation);
  22.     myContainer.GetInventory().CreateInInventory("Glock19");
  23.     myContainer.GetInventory().CreateInInventory("Rag");
  24.     myContainer.GetInventory().CreateInInventory("KitchenKnife");
  25.    
  26.     // Force update collisions
  27.     if (myContainer.CanAffectPathgraph())
  28.     {
  29.         myContainer.SetAffectPathgraph(true, false);
  30.         GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, myContainer);
  31.     }
  32.     // End of code placing a Sea Chest on a coordinate.
  33. }
Advertisement
Add Comment
Please, Sign In to add comment