Custom loot spawnt nicht

  • Habe versucht mit dayz tool die tiers einzurichten dann startet aber mein server nicht mehr bzw der fährt immer wieder hoch aufs neue


    und dann hab ich das mit der getCEapi gemacht geht aber auch nicht das hier ist meine int



    void SpawnObject( string type, vector position, vector orientation )

    {

    auto obj = GetGame().CreateObject( type, position );

    obj.SetPosition( position );

    obj.SetOrientation( orientation );

    obj.SetOrientation( obj.GetOrientation() ); //Collision fix

    obj.Update();

    obj.SetAffectPathgraph( true, false );

    if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );

    }

    void main()

    {

    //INIT ECONOMY--------------------------------------

    Hive ce = CreateHive();

    if ( ce )

    ce.InitOffline();


    //NEA---------

    SpawnObject( "Land_Mil_Barracks2", "11859.268555 141.368362 12557.830078", "114.000000 0.000000 0.000000" );

    SpawnObject( "Land_Mil_Barracks2", "11899.440430 141.368362 12538.732422", "114.000000 0.000000 0.000000" );

    SpawnObject( "Land_Mil_Barracks2", "11839.405273 141.368362 12566.303711", "114.000000 0.000000 0.000000" );

    SpawnObject( "Land_Mil_Barracks2", "11818.813477 141.368362 12575.747070", "114.000000 0.000000 0.000000" );

    SpawnObject( "Land_Mil_Tower_Small", "11813.830078 143.770920 12603.384766", "-69.999962 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11800.122070 141.088547 12579.056641", "-65.000015 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11802.610352 141.100082 12584.574219", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11804.351563 141.108444 12588.316406", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11806.874023 141.117676 12593.715820", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11809.356445 141.118347 12599.211914", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11793.258789 141.118347 12603.945313", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11811.975586 141.118347 12604.611328", "-65.000000 0.000000 0.000000" );

    SpawnObject( "bldr_wall_fen2_6", "11815.793945 141.118347 12606.027344", "25.000002 0.000000 0.000000" );


    //GetCEApi().ExportProxyData( "7500 0 7500", 200000 ); //Center of map, radius of how far to go out and find buildings.



    //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);



    //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 )

    {

    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)

    {

    EntityAI itemTop;

    EntityAI itemEnt;

    ItemBase itemBs;

    float rand;


    itemTop = player.FindAttachmentBySlotName("Body");


    if ( itemTop )

    {

    itemEnt = itemTop.GetInventory().CreateInInventory("Rag");

    if ( Class.CastTo(itemBs, itemEnt ) )

    itemBs.SetQuantity(4);


    SetRandomHealth(itemEnt);


    string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };

    int rndIndex = Math.RandomInt(0, 4);

    itemEnt = itemTop.GetInventory().CreateInInventory(chemlightArray[rndIndex]);

    SetRandomHealth(itemEnt);


    rand = Math.RandomFloatInclusive(0.0, 1.0);

    if ( rand < 0.35 )

    itemEnt = player.GetInventory().CreateInInventory("Apple");

    else if ( rand > 0.65 )

    itemEnt = player.GetInventory().CreateInInventory("Pear");

    else

    itemEnt = player.GetInventory().CreateInInventory("Plum");


    SetRandomHealth(itemEnt);

    }

    }

    };


    Mission CreateCustomMission(string path)

    {

    return new CustomMission();

    }

  • RaVenROx

    Hat den Titel des Themas von „Custom loot spawnt nicht“ zu „Custom loot spawnt nicht schließen bitte is gespawnt“ geändert.
  • zm4ster

    Hat den Titel des Themas von „Custom loot spawnt nicht schließen bitte is gespawnt“ zu „Custom loot spawnt nicht“ geändert.