Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
ACTPA

How to add additional buildings to DAYZ server files?

Recommended Posts

Please help! Help write code to add buildings to server files (init.c)

GetGame().CreateObject("Land_Container_1Moh", "446.953156 422.951996 11226.987305").SetOrientation("132.000000 0.000000 0.000000"); 

 

Share this post


Link to post
Share on other sites
1 hour ago, ACTPA said:

Please help! Help write code to add buildings to server files (init.c)

GetGame().CreateObject("Land_Container_1Moh", "446.953156 422.951996 11226.987305").SetOrientation("132.000000 0.000000 0.000000"); 

 

place this in your init.c within void main you will see where i added your code in just copy and paste as many times as you want to add more in the server

void main()
{

    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();

    Weather weather = g_Game.GetWeather();

    weather.GetOvercast().SetLimits( 0.0 , 1.0 );
    weather.GetRain().SetLimits(0.0, 0.0);
    weather.GetFog().SetLimits( 0.0 , 0.25 );

    weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
    weather.GetRain().SetForecastChangeLimits(0.0, 0.0);
    weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );

    weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
    weather.GetRain().SetForecastTimeLimits( 600 , 600 );
    weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );

    weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
    weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
    weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
    
    weather.SetWindMaximumSpeed(15);
    weather.SetWindFunctionParams(0.1, 0.3, 50);

    //copy from here//

    Object obj;

    //Your edits just copy and change cords
    GetGame().CreateObject("Land_Container_1Moh", "446.953156 422.951996 11226.987305").SetOrientation("132.000000 0.000000 0.000000");

   //Copy to here//

}

 

 

Edited by mrwolv
  • Like 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

×