Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • OPG PROJECT

    Группа ВК

    По-настоящему хороший сервер с уникальным модом! 
     Заходи к нам,тебе тут понравится!
  • 0
DenisRef

Объекты на карте

Подскажите пожалуйста, куда это вписывать в init.c?
 

void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}
SpawnObject("класснейм", "1 1 1", "0.000000 0.000000 0.000000");

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

DenisRef 

 

void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}

Это вставляешь в самом начале файла, или после #include если они у тебя вписаны.

 

#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\PlayersMessagesCount.c"   
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\InfoMessages.c"  
void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}

Вот у меня так стоит, если первых двух строк у тебя нету, тогда просто в самом начале.

Share this post


Link to post
Share on other sites



  • 0

А вот это

SpawnObject("класснейм", "1 1 1", "0.000000 0.000000 0.000000");

вписывается перед закрывающей скобкой в main-функцию в init

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

×
×
  • 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.