Added the code you wrote, exactly as you wrote it. Got a compile error (picture)
This is why I cant follow tutorials. They are ALWAYS wrong in some way, a line in the wrong place or a . , ; : missing or in the wrong place. That´s why I asked for someone that maybe could write a finished init.c file with the spawngear I showed in the initial post. Because I have followed tutorials, videos and so on HUNDREDS of times, but there is ALWAYS something wrong. I will paste the whole init.c file here so maybe someone can see exactly what is wrong with it now.
/**
* init.c
*
* DayZ Expansion Mod
* www.dayzexpansion.com
* © 2020 DayZ Expansion Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*
*/
#include "$CurrentDir:\\mpmissions\\Expansion.ChernarusPlus\\expansion\\ExpansionObjectSpawnTools.c"
#include "$CurrentDir:\\mpmissions\\Expansion.ChernarusPlus\\expansion\\missions\\MissionConstructor.c"
void main()
{
bool loadTraderObjects = false;
bool loadTraderNPCs = false;
string MissionWorldName = "empty";
GetGame().GetWorldName(MissionWorldName);
if (MissionWorldName != "empty")
{
//! Spawn mission objects and traders
FindMissionFiles(MissionWorldName, loadTraderObjects, loadTraderNPCs);
}
//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.02, 0.1), 1, 0);
weather.GetRain().Set( 0, 1, 0);
weather.GetFog().Set( 0, 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 = 8, reset_day = 10;
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)
{
int rndHlt = Math.RandomInt(40,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");
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemEnt;
ItemBase itemBs;
player.RemoveAllItems();
itemEnt = player.GetInventory().CreateInInventory("MountainBag_Blue");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("TShirt_Red");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Jeans_Grey");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Sneakers_Green");
itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("SpaghettiCan");
itemBs = ItemBase.Cast(itemEnt);
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}