Hallo cj187,
habs mal ausprobiert. Funktioniert tadellos.
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, 0);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//DATE RESET AFTER ECONOMY INIT-------------------------
int year;
int month;
int day;
int hour;
int minute;
GetGame().GetWorld().GetDate(year, month, day, hour, minute);
if (((month <= 9) && (day < 20)) ((month >= 10) && (day > 20)))
{
month = 9;
day = 20;
GetGame().GetWorld().SetDate(year, month, day, hour, minute);
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
int rndHlt = Math.RandomInt(55,100);
itemEnt.SetHealth("","",rndHlt);
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
player.RemoveAllItems();
EntityAI itemEnt;
ItemBase itemBs;
player.GetInventory().CreateInInventory("PrisonerCap");
player.GetInventory().CreateInInventory("PrisonUniformJacket");
player.GetInventory().CreateInInventory("PrisonUniformPants");
player.GetInventory().CreateInInventory("Rag");
player.GetInventory().CreateInInventory("Roadflare");
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
LG
Niwjaz