Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1.  
  2. void main()
  3. {
  4. //INIT WEATHER BEFORE ECONOMY INIT------------------------
  5. Weather weather = g_Game.GetWeather();
  6.  
  7. weather.MissionWeather(false); // false = use weather controller from Weather.c
  8.  
  9. weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  10. weather.GetRain().Set( 0, 0, 1);
  11. weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  12.  
  13. //INIT ECONOMY--------------------------------------
  14. Hive ce = CreateHive();
  15. if ( ce )
  16. ce.InitOffline();
  17.  
  18. //DATE RESET AFTER ECONOMY INIT-------------------------
  19. int year, month, day, hour, minute;
  20. int reset_month = 9, reset_day = 20;
  21. GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  22.  
  23. if ((month == reset_month) && (day < reset_day))
  24. {
  25. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  26. }
  27. else
  28. {
  29. if ((month == reset_month + 1) && (day > reset_day))
  30. {
  31. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  32. }
  33. else
  34. {
  35. if ((month < reset_month) || (month > reset_month + 1))
  36. {
  37. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  38. }
  39. }
  40. }
  41. }
  42.  
  43. class CustomMission: MissionServer
  44. {
  45. void SetRandomHealth(EntityAI itemEnt)
  46. {
  47. if ( itemEnt )
  48. {
  49. int rndHlt = Math.RandomInt(55,100);
  50. itemEnt.SetHealth("","",rndHlt);
  51. }
  52. }
  53.  
  54. override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  55. {
  56. Entity playerEnt;
  57. playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
  58. Class.CastTo(m_player, playerEnt);
  59.  
  60. GetGame().SelectPlayer(identity, m_player);
  61.  
  62. return m_player;
  63. }
  64.  
  65. override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  66. {
  67. EntityAI itemTop;
  68. EntityAI itemEnt;
  69. ItemBase itemBs;
  70. float rand;
  71.  
  72. itemTop = player.FindAttachmentBySlotName("Body");
  73.  
  74. if ( itemTop )
  75. {
  76. itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
  77. if ( Class.CastTo(itemBs, itemEnt ) )
  78. itemBs.SetQuantity(6);
  79.  
  80. SetRandomHealth(itemEnt);
  81.  
  82. itemEnt = player.GetInventory().CreateInInventory("HuntingBag");
  83. SetRandomHealth(itemEnt);
  84.  
  85. rand = Math.RandomFloatInclusive(0.0, 1.0);
  86. if ( rand < 0.35 )
  87. itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan");
  88. itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan");
  89. itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan");
  90. itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
  91. itemEnt = player.GetInventory().CreateInInventory("SodaCan_Cola");
  92. itemEnt = player.GetInventory().CreateInInventory("SodaCan_Spite");
  93. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  94.  
  95. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  96. if ( Class.CastTo(itemBs, itemEnt ) )
  97. itemBs.SetQuantity(100);
  98.  
  99. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  100. if ( Class.CastTo(itemBs, itemEnt ) )
  101. itemBs.SetQuantity(100);
  102.  
  103.  
  104. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  105. if ( Class.CastTo(itemBs, itemEnt ) )
  106. itemBs.SetQuantity(100);
  107.  
  108. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  109. if ( Class.CastTo(itemBs, itemEnt ) )
  110. itemBs.SetQuantity(100);
  111.  
  112. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  113. if ( Class.CastTo(itemBs, itemEnt ) )
  114. itemBs.SetQuantity(100);
  115.  
  116. itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
  117. if ( Class.CastTo(itemBs, itemEnt ) )
  118. itemBs.SetQuantity(100);
  119.  
  120. itemEnt = player.GetInventory().CreateInInventory("M4_Suppressor");
  121. itemEnt = player.GetInventory().CreateInInventory("Battery9V");
  122. itemEnt = player.GetInventory().CreateInInventory("ACOGOptic");
  123.  
  124. //WeaponSpawn
  125.  
  126.  
  127. {
  128. EntityAI gun = player.GetHumanInventory().CreateInHands("M4A1");
  129. gun.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
  130. gun.GetInventory().CreateAttachment("M4_MPBttstck_Black");
  131. gun.GetInventory().CreateAttachment("M4_Suppressor");
  132. gun.GetInventory().CreateAttachment("M68Optic");
  133.  
  134. itemEnt = player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
  135. itemEnt = player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
  136. itemEnt = player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
  137. }
  138. }
  139. }
  140. };
  141.  
  142. Mission CreateCustomMission(string path)
  143. {
  144. return new CustomMission();
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement