Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. void SpawnObject(string objectName, vector position, vector orientation)
  2. {
  3. Object obj;
  4. obj = Object.Cast(GetGame().CreateObject(objectName, "0 0 0"));
  5. obj.SetPosition(position);
  6. obj.SetOrientation(orientation);
  7.  
  8. // Force update collisions
  9. if (obj.CanAffectPathgraph())
  10. {
  11. obj.SetAffectPathgraph(true, false);
  12. GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
  13. }
  14. }
  15.  
  16. #include "$CurrentDir:\\mpmissions\\yRun.chernarusplus\\Buildings\\NorthSZ.c"
  17. #include "$CurrentDir:\\mpmissions\\yRun.chernarusplus\\Buildings\\SouthSZ.c"
  18. #include "$CurrentDir:\\mpmissions\\yRun.chernarusplus\\Buildings\\NWAF.c"
  19. #include "$CurrentDir:\\mpmissions\\yRun.chernarusplus\\Buildings\\SWAF.c"
  20. #include "$CurrentDir:\\mpmissions\\yRun.chernarusplus\\Buildings\\NEAF.c"
  21.  
  22. void main()
  23. {
  24.  
  25.  
  26. //INIT ECONOMY--------------------------------------
  27. Hive ce = CreateHive();
  28. if ( ce )
  29. ce.InitOffline();
  30.  
  31. //DATE RESET AFTER ECONOMY INIT-------------------------
  32. int year, month, day, hour, minute;
  33. int reset_month = 9, reset_day = 20;
  34. GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  35.  
  36. if ((month == reset_month) && (day < reset_day))
  37. {
  38. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  39. }
  40. else
  41. {
  42. if ((month == reset_month + 1) && (day > reset_day))
  43. {
  44. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  45. }
  46. else
  47. {
  48. if ((month < reset_month) || (month > reset_month + 1))
  49. {
  50. GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  51. }
  52. }
  53. }
  54.  
  55. //INIT WEATHER AFTER ECONOMY INIT------------------------
  56. Weather weather = g_Game.GetWeather();
  57.  
  58. weather.MissionWeather(true); // false = use weather controller from Weather.c
  59.  
  60. weather.GetRain().SetLimits( 0.0 , 0.0 );
  61. weather.GetOvercast().SetLimits( 0.0 , 0.0 );
  62. weather.GetFog().SetLimits( 0.0 , 0.01 );
  63.  
  64. weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.0 );
  65. weather.GetRain().SetForecastChangeLimits( 0.0, 0.0 );
  66. weather.GetFog().SetForecastChangeLimits( 0.0, 0.1 );
  67.  
  68. weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
  69. weather.GetRain().SetForecastTimeLimits( 600 , 600 );
  70. weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );
  71.  
  72. weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
  73. weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
  74. weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
  75.  
  76. weather.SetWindMaximumSpeed(5);
  77. weather.SetWindFunctionParams(0.1, 0.3, 50);
  78.  
  79. SAFEZONE_NORTH();
  80. SAFEZONE_SOUTH();
  81. NWAF();
  82. SWAF();
  83. NEAF();
  84.  
  85.  
  86.  
  87. //GetCEApi().ExportProxyData( "7500 0 7500", 10000 ); //Center of map, radius of how far to go out and find buildings.
  88. }
  89.  
  90. class CustomMission: MissionServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement