Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
spi4kin

Помогите с настройкой спавна объектов!

Вообщем выглядит все так - однако выдает ошибки! координаты делал Эдитор!

 

это файл - spawn_buildings.c:

 

void SpawnObject(string type, vector position, vector orientation, float scale = 1.0)
{
    Object obj = GetGame().CreateObjectEx(type, position, ECE_SETUP | ECE_UPDATEPATHGRAPH | ECE_CREATEPHYSICS);
    obj.SetPosition(position);
    obj.SetOrientation(orientation);
    obj.SetOrientation(obj.GetOrientation());
    obj.SetScale(scale);
    obj.Update();
    obj.SetAffectPathgraph(true, false);
    if (obj.CanAffectPathgraph()) {
        GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
    } 
}

void SpawnBarmen();
{
SpawnObject("bldr_prop_RefrigeratorMinsk", "5245.582520 182.890854 3684.383789", "-121.613655 0.000000 -0.000000", 0.999999);
SpawnObject("bldr_prop_Plant_Cannabis", "5242.600586 183.612640 3686.916260", "-132.562836 -0.000000 -0.000000", 1);
SpawnObject("Land_Misc_Well_Pump_Blue", "5253.580078 182.225006 3678.830078", "-170.999985 0.000000 0.000000", 0.99);
SpawnObject("Land_Misc_Greenhouse", "5251.900879 184.034866 3690.741699", "57.664776 0.000000 -0.000000", 0.999998);
SpawnObject("bldr_prop_Vodka", "5243.763672 183.875580 3684.873779", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_SodaCan_Spite", "5243.698730 183.804535 3684.948730", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_Cleaver", "5245.058105 184.632507 3685.137207", "149.835953 0.000000 -24.000000", 0.999995);
SpawnObject("bldr_prop_HuntingBag", "5245.643066 184.065063 3684.208008", "150.433960 89.534790 10.499999", 0.999996);
SpawnObject("bldr_prop_MeatTenderizer", "5243.464355 183.771439 3686.856201", "-5.499998 -88.335281 -63.500000", 0.999979);
SpawnObject("bldr_prop_Radio", "5242.202637 183.744934 3686.815918", "-11.499997 0.000000 0.000000", 0.999997);
SpawnObject("bldr_prop_CigarettePack_Partyzanka", "5243.044922 183.742859 3685.597656", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_CigarettePack_Chernamorka", "5242.919922 183.770996 3685.590088", "-23.499998 0.000000 0.000000", 0.999995);
SpawnObject("bldr_prop_Candle", "5243.387207 183.790939 3685.356689", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_Pot", "5243.259277 183.736176 3687.516113", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_FryingPan", "5243.404297 183.740524 3687.265381", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_SodaCan_Cola", "5243.912109 183.803253 3684.946533", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_AntiPestsSpray", "5243.400879 183.906555 3685.979492", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_BakedBeansCan", "5242.938965 183.750412 3687.287598", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_BakedBeansCan_Opened", "5241.691895 183.783768 3683.673584", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("vbldr_trailmap_noarrow", "5243.311523 182.990112 3679.839111", "-33.273140 0.000000 0.000000", 0.999996);
SpawnObject("vbldr_windpowerplant_grey", "5255.007324 206.475586 3707.297363", "-26.999990 0.000000 0.000000", 1);
SpawnObject("vbldr_slum_roof3", "5249.276367 183.749390 3696.409668", "-124.199951 0.000000 -0.000000", 1);
SpawnObject("vbldr_flowerpot_prx", "5242.574707 183.742020 3686.973389", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_kitchenstove_elec", "5243.434082 182.890259 3687.431885", "-32.834911 0.000000 0.000000", 0.999992);
SpawnObject("bldr_drapes", "5243.348145 184.436554 3682.716064", "150.899750 -0.000000 -0.000000", 1);
SpawnObject("bldr_drapes", "5244.192383 184.444885 3683.199463", "147.436584 -0.000000 -0.000000", 1);
SpawnObject("bldr_mil_camonet_roof_nato", "5255.520996 184.670853 3696.916748", "62.999973 -0.000000 -0.000000", 1);
SpawnObject("bldr_Carp", "5244.364258 185.059204 3685.763428", "-91.378670 -0.000000 -0.000000", 0.999999);
SpawnObject("bldr_Carp", "5244.171875 185.050537 3685.636230", "-134.087814 -0.000000 -0.000000", 0.999999);
SpawnObject("bldr_Carp", "5243.966797 185.051895 3685.559814", "-91.378670 -0.000000 -0.000000", 0.999999);
SpawnObject("bldr_GoatSteakMeat", "5243.412598 183.743332 3687.275146", "-82.945244 -0.000000 -0.000000", 0.999998);
SpawnObject("bldr_Pumpkin", "5242.925293 183.461014 3685.906982", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_FoxSteakMeat", "5243.152832 183.749588 3686.899658", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_PigSteakMeat", "5243.050781 183.739410 3687.041748", "28.830978 -0.000000 -0.000000", 1);
SpawnObject("bldr_TunaCan_Opened", "5241.686523 183.768509 3683.545898", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_Canteen", "5241.541016 183.904160 3683.705322", "-84.070778 -0.000000 -0.000000", 1);
SpawnObject("bldr_Vodka", "5241.641113 183.891037 3683.443604", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_SodaCan_Kvass", "5242.263672 183.829453 3683.876709", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_SodaCan_Spite", "5241.560547 183.831100 3683.556152", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_picture_a_04", "5245.505371 183.841507 3684.728271", "-121.573524 0.000000 -0.000000", 1);
SpawnObject("bldr_picture_c_02", "5245.112305 183.857422 3683.774902", "-32.399853 0.000000 0.000000", 1);
SpawnObject("bldr_picture_a_05", "5241.258789 183.808426 3683.732910", "55.799995 -0.000000 -0.000000", 1);
SpawnObject("vbldr_hanged_doctor", "5255.862305 210.957947 3708.714844", "-127.781647 -0.000000 -0.000000", 0.999997);
SpawnObject("vbldr_hanged_civil", "5256.131836 211.010544 3708.183105", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_PowerGenerator", "5248.255859 182.827438 3692.099609", "-35.999969 0.000000 0.000000", 1);
SpawnObject("bldr_prop_BatteryCharger", "5247.155762 183.626358 3691.451660", "148.546951 0.000000 0.000000", 1);
SpawnObject("bldr_prop_CableReel", "5246.925293 183.597763 3691.166016", "107.999962 0.000000 -0.000000", 1);
SpawnObject("Land_Roadblock_Table", "5246.768555 183.231079 3691.161621", "146.916016 0.000000 0.000000", 0.999999);
SpawnObject("bldr_prop_CowboyHat_black", "5243.997070 185.171967 3687.060547", "-125.999924 0.000000 -0.000000", 1);
SpawnObject("bldr_prop_AirborneMask", "5242.551270 183.745529 3686.475342", "0.000000 -0.000000 -0.000000", 1);
SpawnObject("bldr_prop_FryingPan", "5244.017090 184.453873 3687.053223", "-34.244389 0.499953 -90.000000", 0.999989);
}

 

Ошибка такая в логах.: 

 

Function: 'SpawnObject'
Stack trace:
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:4
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:18
$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c:33
SCRIPT    (E): NULL pointer to instance


Function: 'SpawnObject'
Stack trace:
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:4
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:39
$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c:33
SCRIPT    (E): NULL pointer to instance


Function: 'SpawnObject'
Stack trace:
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:4
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:60
$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c:33
SCRIPT    (E): NULL pointer to instance


Function: 'SpawnObject'
Stack trace:
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:4
$CurrentDir:mpmissions/dayzOffline.chernarusplus/spawn_buildings.c:64
$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c:33

 

Помогите пожалуйста! в чем ошибка!!!!?????

 

А это в Init.c:

 

#include "$CurrentDir:mpmissions\dayzOffline.chernarusplus\spawn_buildings.c"

void main()
{
    //INIT ECONOMY--------------------------------------
    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();

    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year, month, day, hour, minute;
    int reset_month = 7, reset_day = 15;
    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);
            }
        }
    }
    SpawnBarmen();
}

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Помести функцию SpawnObject над функцией main в init.c

Share this post


Link to post
Share on other sites



  • 0

@spi4kin Тыыыыыща тем на форуме, как прописать спав объектов и лута. Пользуйся поиском. Не тереби инит.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.