Das ist übrigens der init.c Code, der bei mir geklappt hat, eine Mischung aus mehreren am ENde. Wetter und Zeit Settings sind wie im original Spiel...
Code
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();
//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);
}
}
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
float rndHlt = Math.RandomFloat( 0.25, 0.65 )
itemEnt.SetHealth01( "", "", rndHlt );
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
Class.CastTo( m_player, playerEnt );
GetGame().SelectPlayer( identity, m_player );
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemEnt;
ItemBase itemBs;
//Entitys
EntityAI gun_m4a1;
EntityAI gun_fnx45;
EntityAI cloth_gorkaHelmet;
EntityAI cloth_militaryBoots;
//Get & Save Admin UIDs
const string admin_uid = "xxxxxxx";
const string admin_uid2 = "xxxxxxx";
string player_uid = player.GetIdentity().GetPlainId();
//RemoveAllItems
player.RemoveAllItems();
//Check if admin or not and choose spawn type
if(player_uid == admin_uid || player_uid == admin_uid2)
{
// ADMIN SPAWN
//Backpack
ItemBase.Cast(player.GetInventory().CreateInInventory("HuntingBag"));
//Clothing
cloth_gorkaHelmet = player.GetInventory().CreateInInventory("GorkaHelmet");
//cloth_gorkaHelmet.GetInventory().CreateAttachment("GorkaHelmetVisor"); //not working, don't know why
cloth_militaryBoots = player.GetInventory().CreateInInventory("MilitaryBoots_Black");
cloth_militaryBoots.GetInventory().CreateAttachment("CombatKnife"); //attach the knife to the boots
ItemBase.Cast(player.GetInventory().CreateInInventory("BalaclavaMask_Blackskull"));
ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalGloves_Black"));
ItemBase.Cast(player.GetInventory().CreateInInventory("TTsKOJacket_Camo"));
ItemBase.Cast(player.GetInventory().CreateInInventory("TTSKOPants"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Armband_White"));
//Primary Weapon
gun_m4a1 = player.GetHumanInventory().CreateInHands("M4A1"); //if not working you can try .GetEntityInHands()
//attach the following attachments to the gun
gun_m4a1.GetInventory().CreateAttachment("ACOGOptic");
gun_m4a1.GetInventory().CreateAttachment("M4_Suppressor");
gun_m4a1.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
gun_m4a1.GetInventory().CreateAttachment("M4_OEBttstck_Black");
gun_m4a1.GetInventory().CreateAttachment("Light_Universal");
//gun_m4a1.GetInventory().CreateAttachment("Mag_STANAG_30Rnd"); BUGGY DONT USE
//addMags(player, "Mag_STANAG_30Rnd", 2); //addMags(player, "Mag_STANAGCoupled_30Rnd", 2);
// Secondary Weapon
gun_fnx45 = player.GetInventory().CreateInInventory("FNX45");
gun_fnx45.GetInventory().CreateAttachment("PistolSuppressor");
//gun_fnx45.GetInventory().CreateAttachment("Mag_FNX45_15Rnd"); BUGGY DONT USE
//Ammunition
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
//Food
ItemBase.Cast(player.GetInventory().CreateInInventory("SodaCan_Pipsi"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SodaCan_Pipsi"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SodaCan_Pipsi"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SpaghettiCan"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SpaghettiCan"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SpaghettiCan"));
// Medical Supplies
ItemBase.Cast(player.GetInventory().CreateInInventory("Morphine"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6);
// Utilities
ItemBase.Cast(player.GetInventory().CreateInInventory("CanOpener"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Battery9V"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Battery9V"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Battery9V"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SparkPlug"));
ItemBase.Cast(player.GetInventory().CreateInInventory("TetracyclineAntibiotics"));
//CreateQuickbar Shortcuts, 0 is the 1st place, 1 the 2nd etc.
player.SetQuickBarEntityShortcut(gun_m4a1, 0, true); //you can use without true, true is for forcing player.SetQuickBarEntityShortcut(gun_m4a1, 0);
player.SetQuickBarEntityShortcut(gun_fnx45, 1, true);
}
else
{
// DEFAULT SPAWN
//Backpack
ItemBase.Cast(player.GetInventory().CreateInInventory("DryBag_Green"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_60Rnd"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_60Rnd"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_60Rnd"));
//Clothing
//cloth_gorkaHelmet = player.GetInventory().CreateInInventory("GorkaHelmet");
//cloth_gorkaHelmet.GetInventory().CreateAttachment("GorkaHelmetVisor"); //not working, don't know why
cloth_militaryBoots = player.GetInventory().CreateInInventory("MilitaryBoots_Black");
cloth_militaryBoots.GetInventory().CreateAttachment("CombatKnife"); //attach the knife to the boots
//ItemBase.Cast(player.GetInventory().CreateInInventory("BalaclavaMask_Blackskull"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalGloves_Black"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("BDUJacket"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("BDUPants"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("Armband_Yellow"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("HighCapacityVest_Olive"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("JoggingShoes_Black"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Jeans_BlueDark"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Raincoat_Black"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("JoggingShoes_Black"));
//Primary Weapon
//gun_m4a1 = player.GetHumanInventory().CreateInHands("M4A1"); //if not working you can try .GetEntityInHands()
//attach the following attachments to the gun
//gun_m4a1.GetInventory().CreateAttachment("ACOGOptic");
//gun_m4a1.GetInventory().CreateAttachment("M4_Suppressor");
//gun_m4a1.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
//gun_m4a1.GetInventory().CreateAttachment("M4_OEBttstck_Black");
//gun_m4a1.GetInventory().CreateAttachment("Light_Universal");
//gun_m4a1.GetInventory().CreateAttachment("Mag_STANAG_30Rnd"); BUGGY DONT USE
//addMags(player, "Mag_STANAG_60Rnd", 2);
//addMags(player, "Mag_STANAGCoupled_60Rnd", 2);
// Secondary Weapon
gun_fnx45 = player.GetInventory().CreateInInventory("FNX45");
gun_fnx45.GetInventory().CreateAttachment("PistolSuppressor");
//gun_fnx45.GetInventory().CreateAttachment("Mag_FNX45_15Rnd"); BUGGY DONT USE
//Ammunition
//ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_STANAG_30Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd"));
//Food
//ItemBase.Cast(player.GetInventory().CreateInInventory("SpaghettiCan"));
ItemBase.Cast(player.GetInventory().CreateInInventory("TacticalBaconCan"));
ItemBase.Cast(player.GetInventory().CreateInInventory("SodaCan_Kvass"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("SodaCan_Pipsi"));
// Medical Supplies
//ItemBase.Cast(player.GetInventory().CreateInInventory("Morphine"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Rag")).SetQuantity(6);
// Utilities
//ItemBase.Cast(player.GetInventory().CreateInInventory("CanOpener"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Flashlight"));
ItemBase.Cast(player.GetInventory().CreateInInventory("Battery9V"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("Battery9V"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("SparkPlug"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("SparkPlug"));
//ItemBase.Cast(player.GetInventory().CreateInInventory("TetracyclineAntibiotics"));
//CreateQuickbar Shortcuts
player.SetQuickBarEntityShortcut(gun_fnx45, 0, true);
}
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
Alles anzeigen