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  
ShrimpSL

Проблема с настройкой стартового лута в init.c

Всем привет, решил завести стартовый лут на свой сервак.

Все делал по инструкциям, но при этом сервер постоянно жалуется на 79 строчку в файле. Но там я не обнаружил ничего странного. Что делать не понимаю, полный init.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 = 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 )
        {
            float rndHlt = Math.RandomFloat( 0.45, 0.65 );
            itemEnt.SetHealth01( "", "", rndHlt );
        }
    }

    override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
    {
        Entity playerEnt;
        playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
        Class.CastTo( m_player, playerEnt );

        GetGame().SelectPlayer( identity, m_player );

        return m_player;
    }

    override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
    {
        player.RemoveAllItems();
        
        EntityAI itemEnt;
        ItemBase itemBs;
        
        switch (Math.RandomInt(0, 1)) { 
        case 0:
        
        player.GetInventory().CreateInInventory("DUG_GorkaEJacket_DigitalFlora");itemBs = ItemBase.Cast(itemEnt); //Горка куртка флора
        player.GetInventory().CreateInInventory("DUG_GorkaPants_DigitalFlora");itemBs = ItemBase.Cast(itemEnt); // Горка штаны флора
        player.GetInventory().CreateInInventory("MilitaryBoots_Black");itemBs = ItemBase.Cast(itemEnt); // берцы
        player.GetInventory().CreateInInventory("Canteen");itemBs = ItemBase.Cast(itemEnt); // фляга
        player.GetInventory().CreateInInventory("TacticalBaconCan");itemBs = ItemBase.Cast(itemEnt); // Бекон 
        player.GetInventory().CreateInInventory("CombatKnife");itemBs = ItemBase.Cast(itemEnt); // Милитари нож
        player.GetInventory().CreateInInventory("BandageDressing");itemBs = ItemBase.Cast(itemEnt); // бинты
        player.GetInventory().CreateInInventory("Chemlight_Green");itemBs = ItemBase.Cast(itemEnt); //химсвет
        break;
        }
    }
};

Mission CreateCustomMission(string path);
{
    return new CustomMission();
}

image.png.4d42c18f1ca57a54179b7249df262cba.pngimage.png.6e51e539158a2a9b7309778d367dd917.png

Edited by ShrimpSL (see edit history)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts




  • 0
6 часов назад, Hellkot сказал:

{
    return new CustomMission();
};

;  забыл.

Та же проблема, 79 строчка с той же ошибкой 

Share this post


Link to post
Share on other sites
  • 0
21.12.2022 в 20:59, Dimon_UA сказал:

Mission CreateCustomMission(string path) { return new CustomMission(); }


Mission CreateCustomMission(string path)
{
	return new CustomMission();
}

78 - убери ";"

Помогло!
Спасибо большое @Dimon_UA

Edited by ShrimpSL (see edit history)

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.