zovkx

Untitled

Sep 5th, 2019
1,940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Airfield\caves.c"
  2. #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Airfield\BridgePrisonNoWrecks.c"
  3. //Spawn helper function
  4.  
  5. void SpawnObject(string objectName, vector position, vector orientation)
  6. {
  7. Object obj;
  8. obj = Object.Cast(GetGame().CreateObject(objectName, "0 0 0"));
  9. obj.SetPosition(position);
  10. obj.SetOrientation(orientation);
  11. //Force collision update
  12. vector roll = obj.GetOrientation();
  13. roll [ 2 ] = roll [ 2 ] - 1;
  14. obj.SetOrientation( roll );
  15. roll [ 2 ] = roll [ 2 ] + 1;
  16. obj.SetOrientation( roll );
  17.  
  18. // Force update collisions
  19. if (obj.CanAffectPathgraph())
  20. {
  21. obj.SetAffectPathgraph(true, false);
  22. GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
  23. }
  24. }
  25. void main()
  26. {
  27.  
  28. //INIT WEATHER BEFORE ECONOMY INIT------------------------
  29. Weather weather = g_Game.GetWeather();
  30.  
  31. weather.MissionWeather(false); // false = use weather controller from Weather.c
  32.  
  33. weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  34. weather.GetRain().Set( 0, 0, 1);
  35. weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  36.  
  37. //INIT ECONOMY--------------------------------------
  38. Hive ce = CreateHive();
  39. if ( ce )
  40. ce.InitOffline();
  41.  
  42.  
  43.  
  44. BridgePrisonNoWrecks();
  45. caves();
  46.  
  47.  
  48. //GetCEApi().ExportProxyData( "7500 0 7500", 100000 ); //Center of map, radius of how far to go out and find buildings.
  49.  
  50. //DATE RESET AFTER ECONOMY INIT-------------------------
  51. int year, month, day, hour, minute;
  52. int reset_month = 9, reset_day = 20;
  53. GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  54.  
  55. if ((month == reset_month) && (day < reset_day))
  56. {
  57. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  58. }
  59. else
  60. {
  61. if ((month == reset_month + 1) && (day > reset_day))
  62. {
  63. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  64. }
  65. else
  66. {
  67. if ((month < reset_month) || (month > reset_month + 1))
  68. {
  69. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  70. }
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment