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
Дизайнер

Как сделать спавн ящика с лутом внутри?

Всем привет. Сразу скажу чтобы прояснить ситуацию, я новичок и ничего в скриптах не понимаю, но умею вникать в тему если меня кто-то направит. Я смогу выбрать точки спавна любых предметов (в моем случае ящиков) и расставить их по карте, но (дальше то, что не понимаю как сделать) суть в том что в них должен быть определенный лут. Спавнить ящики я собираюсь через простой серверный мод с помощью SpawnObject( );  . Вот код того мода-спавнера:

 

ref MyBuildingsClass g_MyBuildingsClass = new MyBuildingsClass; 

class MyBuildingsClass
{
    void MyBuildingsClass() 
    {
        init() 
        delete g_MyBuildingsClass; 
    }
    
    void init()    
    {
        // Начало


        SpawnObject( "PPW_TrashCan", "4539.790039 71.363197 1815.689941", "163.999985 0.000000 -0.000000" );
      

        //Конец
    }
    void SpawnObject(string objectName, vector position, vector orientation)
    {
        Object obj;
        obj = Object.Cast(GetGame().CreateObject(objectName, "1 500 1"));
        obj.SetPosition(position);
        obj.SetOrientation(orientation);

           if (obj.CanAffectPathgraph())
        {
            obj.SetAffectPathgraph(true, false);
            GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
        }
        else
        {
            orientation = obj.GetOrientation();
            orientation[0] = orientation[0] + 1;
            obj.SetOrientation(orientation);
            orientation[0] = orientation[0] - 1;
            obj.SetOrientation(orientation);
            orientation[1] = orientation[1] + 1;
            obj.SetOrientation(orientation);
            orientation[1] = orientation[1] - 1;
            obj.SetOrientation(orientation);
            orientation[2] = orientation[2] + 1;
            obj.SetOrientation(orientation);
            orientation[2] = orientation[2] - 1;
            obj.SetOrientation(orientation);
        }
    }
}

 

Edited by 123new
вставка кода файла в спец. тег для его вставки (see edit history)

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts




  • 0

Ящики спанятся как кастомные постройки??? Эээээ,а смысл?

Share this post


Link to post
Share on other sites
  • 0

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

наказания выданы, перемещено в корректный раздел.

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.