Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Airfield\caves.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Airfield\BridgePrisonNoWrecks.c"
- //Spawn helper function
- void SpawnObject(string objectName, vector position, vector orientation)
- {
- Object obj;
- obj = Object.Cast(GetGame().CreateObject(objectName, "0 0 0"));
- obj.SetPosition(position);
- obj.SetOrientation(orientation);
- //Force collision update
- vector roll = obj.GetOrientation();
- roll [ 2 ] = roll [ 2 ] - 1;
- obj.SetOrientation( roll );
- roll [ 2 ] = roll [ 2 ] + 1;
- obj.SetOrientation( roll );
- // Force update collisions
- if (obj.CanAffectPathgraph())
- {
- obj.SetAffectPathgraph(true, false);
- GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
- }
- }
- void main()
- {
- //INIT WEATHER BEFORE ECONOMY INIT------------------------
- Weather weather = g_Game.GetWeather();
- weather.MissionWeather(false); // false = use weather controller from Weather.c
- weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
- weather.GetRain().Set( 0, 0, 1);
- weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
- //INIT ECONOMY--------------------------------------
- Hive ce = CreateHive();
- if ( ce )
- ce.InitOffline();
- BridgePrisonNoWrecks();
- caves();
- //GetCEApi().ExportProxyData( "7500 0 7500", 100000 ); //Center of map, radius of how far to go out and find buildings.
- //DATE RESET AFTER ECONOMY INIT-------------------------
- int year, month, day, hour, minute;
- int reset_month = 9, reset_day = 20;
- GetGame().GetWorld().GetDate(year, month, day, hour, minute);
- if ((month == reset_month) && (day < reset_day))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- else
- {
- if ((month == reset_month + 1) && (day > reset_day))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- else
- {
- if ((month < reset_month) || (month > reset_month + 1))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment