Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...
  • Нужна помощь?

    Создайте тему в соответствующем разделе
    Не нужно писать всё в чат!
  • Загляните на торговую площадку

    Там вы можете купить
    всё что касается игровых серверов
  • Не хотите бан?

    Пожалуйста, ознакомьтесь с нашими правилами
    Не нарушайте порядок!
  • Продаёте или покупаете?

    Пользуйтесь услугами гаранта
    Мы сделаем вашу сделку безопасной
  • 0
fluffy

в чём ошибка? init.c

$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c(119): Expected '(', not a 'Р'

в чём проблема ?)
 

//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    obj.SetOrientation( obj.GetOrientation() ); //Collision fix
    obj.Update();
    obj.SetAffectPathgraph( true, false );
    if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
}

void main()
{
	//Your custom spawned objects

	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//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 )
		{
			int rndHlt = Math.RandomInt(55,100);
			itemEnt.SetHealth("","",rndHlt);
		}
	}

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

		return m_player;
	}

	void addMags(PlayerBase player, string mag_type, int count)
	{
		if (count < 1)
			return;

		EntityAI mag;

		for (int i = 0; i < count; i++) {
			mag = player.GetInventory().CreateInInventory(mag_type);
		}

		player.SetQuickBarEntityShortcut(mag, 1, true);
	}

	EntityAI oneClass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("M4A1");
		gun.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
		gun.GetInventory().CreateAttachment("M4_MPBttstck_Black");
		gun.GetInventory().CreateAttachment("ACOGOptic");
		addMags(player, "Mag_STANAG_30Rnd", 3);

		return gun;
	}

	EntityAI twoClass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("SVD");
		gun.GetInventory().CreateAttachment("PSO1Optic");
		addMags(player, "Mag_SVD_10Rnd", 3);

		return gun;
	}

	EntityAI threeClass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("UMP45");
		gun.GetInventory().CreateAttachment("PistolSuppressor");
		addMags(player, "Mag_UMP_25Rnd", 3);

		return gun;
	}

	EntityAI fiveСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("AKM");
		gun.GetInventory().CreateAttachment("AK_WoodBttstck");
		gun.GetInventory().CreateAttachment("AK_WoodHndgrd");
		addMags(player, "Mag_AKM_30Rnd", 5);

		return gun;
	}
	
	EntityAI sixСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("Mosin9130");
		gun.GetInventory().CreateAttachment("PUScopeOptic");
		addMags(player, "Ammo_762x54", 3);

		return gun;
	}
	
	EntityAI sevenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("FAL");
		gun.GetInventory().CreateAttachment("Fal_FoldingBttstck");
		gun.GetInventory().CreateAttachment("ACOGOptic");
		addMags(player, "Mag_FAL_20Rnd", 6);

		return gun;
	}
	
	EntityAI eightСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("Saiga");
		gun.GetInventory().CreateAttachment("Saiga_Bttstck");
		gun.GetInventory().CreateAttachment("KobraOptic");
		addMags(player, "Mag_Saiga_8Rnd", 5);

		return gun;
	}
	
	EntityAI nineСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("M4A1");
		gun.GetInventory().CreateAttachment("M4_RISHndgrd_Black");
		gun.GetInventory().CreateAttachment("M4_MPBttstck_Black");
		gun.GetInventory().CreateAttachment("M68Optic");
		addMags(player, "Mag_STANAGCoupled_30Rnd", 3);
		
		return gun;
	}
	
	EntityAI tenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("B95");
		gun.GetInventory().CreateAttachment("HuntingOptic");
		addMags(player, "Ammo_308Win", 3);
		
		return gun;
	}
	
	EntityAI elevenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("Winchester70");
		gun.GetInventory().CreateAttachment("HuntingOptic");
		addMags(player, "Ammo_308Win", 3);
		
		return gun;
	}
	
	EntityAI twelveСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("AK74");
		gun.GetInventory().CreateAttachment("AK_RailHndgrd");
		gun.GetInventory().CreateAttachment("AK_PlasticBttstck");
		gun.GetInventory().CreateAttachment("KashtanOptic");
		addMags(player, "Mag_AK74_30Rnd", 5);
		
		return gun;
	}
	
	EntityAI thirteenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("AK101");
		gun.GetInventory().CreateAttachment("AK_PlasticHndgrd");
		gun.GetInventory().CreateAttachment("AK_PlasticBttstck");
		gun.GetInventory().CreateAttachment("KobraOptic");
		addMags(player, "Mag_AK101_30Rnd", 5);
		
		return gun;
	}
	
	EntityAI fourteenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("MP5K");
		gun.GetInventory().CreateAttachment("PistolSuppressor");
		gun.GetInventory().CreateAttachment("MP5_PlasticHndgrd");
		gun.GetInventory().CreateAttachment("MP5k_StockBttstck");
		gun.GetInventory().CreateAttachment("ReflexOptic");
		addMags(player, "Mag_MP5_30Rnd", 5);
		
		return gun;
	}
	
	EntityAI fifteenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("SKS");
		gun.GetInventory().CreateAttachment("PUScopeOptic");
		addMags(player, "Ammo_762x39", 5);
		
		return gun;
	}
	
	EntityAI sixteenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("AKM");
		gun.GetInventory().CreateAttachment("AK_WoodBttstck");
		gun.GetInventory().CreateAttachment("AK_WoodHndgrd");
		gun.GetInventory().CreateAttachment("AK_Suppressor");
		addMags(player, "Mag_AKM_30Rnd", 5);
		return gun;
	}
	
	EntityAI seventeenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("VSS");
		gun.GetInventory().CreateAttachment("PSO1Optic");
		addMags(player, "Mag_VSS_10Rnd", 5);
		
		return gun;
	}
	
	EntityAI eighteenСlass(PlayerBase player)
	{
		EntityAI gun = player.GetHumanInventory().CreateInHands("AKS74U");
		gun.GetInventory().CreateAttachment("AKS74U_Bttstck");
		addMags(player, "Mag_AK74_30Rnd", 5);
		
		return gun;
	}
	
	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();

		player.GetInventory().CreateInInventory("TTSKOPants");
		player.GetInventory().CreateInInventory("TTsKOJacket_Camo");
		player.GetInventory().CreateInInventory("CombatBoots_Black");
		player.GetInventory().CreateInInventory("ImprovisedBag");
		

		player.GetInventory().CreateInInventory("SodaCan_Pipsi");
		player.GetInventory().CreateInInventory("SpaghettiCan");
		player.GetInventory().CreateInInventory("HuntingKnife");
		ItemBase rags = player.GetInventory().CreateInInventory("Rag");
		rags.SetQuantity(4);

		EntityAI primary;
		EntityAI axe = player.GetInventory().CreateInInventory("FirefighterAxe");

		switch (Math.RandomInt(0, 17)) {
			case 0: primary = oneСlass(player); break;
			case 1: primary = twoClass(player); break;
			case 2: primary = threeClass(player); break;
			case 3: primary = fiveСlass(player); break;
			case 4: primary = sixСlass(player); break;
			case 5: primary = sevenСlass(player); break;
			case 6: primary = eightСlass(player); break;
			case 7: primary = nineСlass(player); break;
			case 8: primary = tenСlass(player); break;
			case 9: primary = elevenСlass(player); break;
			case 10: primary = twelveСlass(player); break;
			case 11: primary = thirteenСlass(player); break;
			case 12: primary = fourteenСlass(player); break;
			case 13: primary = fifteenСlass(player); break;
			case 14: primary = sixteenСlass(player); break;
			case 15: primary = seventeenСlass(player); break;
			case 16: primary = eighteenСlass(player); break;			
		}

		player.LocalTakeEntityToHands(primary);
		player.SetQuickBarEntityShortcut(primary, 0, true);
		player.SetQuickBarEntityShortcut(rags, 2, true);
		player.SetQuickBarEntityShortcut(axe, 3, true);
	}
};

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

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Рекомендованные сообщения

  • 0

мой совет, ASCII или UTF-8 без BOM кодировки ставьте, иные как я понял не воспринимает

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах





  • 0

Решил проблему, проблема в кодировке и скрытых символах. 
Нужно было перепечатать код в ручную и всё будет работать:)

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас

×
×
  • Создать...

Важная информация

Используя этот сайт, вы автоматически обязуетесь соблюдать наши Правила и Политика конфиденциальности.
Чтобы сделать этот веб-сайт лучше, мы разместили cookies на вашем устройстве. Вы можете изменить свои настройки cookies, в противном случае мы будем считать, что вы согласны с этим.