Advertisement
Guest User

init.c to winit.c

a guest
Feb 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.50 KB | None | 0 0
  1. #include "$CurrentDir:\\mpmissions\\DayZSurvival.chernarusplus\\ScriptedMods\\Modules\\ServerMission\\DayZSurvival.c"
  2.  
  3. Mission CreateCustomMission(string path)
  4. {
  5.     return new DayZSurvival();
  6. }
  7.  
  8.  
  9. void main()
  10. {
  11.     //INIT WEATHER BEFORE ECONOMY INIT------------------------
  12.     Weather weather = g_Game.GetWeather();
  13.     weather.MissionWeather(false);    // false = use weather controller from Weather.c
  14.     weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  15.     weather.GetRain().Set( 0, 0, 1);
  16.     weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  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.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen);
  42.     {
  43.         player.GetStatEnergy().Set(5000);
  44.         player.GetStatWater().Set(5000);
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement