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

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

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

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

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

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






  • 0

BorizzK so that the stamina bar does not lower when picking up items

 

20190815192037_14ik9s.jpg

Изменено пользователем hooligan334 (история изменений)

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


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

hooligan334 may be in PlayerBase:

 

try to modding this functions

 

	float GetPlayerLoad()
	{
		return m_CargoLoad;
	}
	
	bool IsOverloaded()
	{
		if ( GetPlayerLoad() >= OVERLOAD_LIMIT ) return true;
		return false;
	}

	void SetPlayerLoad(float load)
	{
		m_CargoLoad = load;
		
		//Log(ToString(this) + "'s load weight is " + ftoa(m_CargoLoad) + " g.", LogTemplates.TEMPLATE_PLAYER_WEIGHT);
	}

	void AddPlayerLoad(float addedload)
	{
		float newload = GetPlayerLoad() + addedload;
		SetPlayerLoad(newload);
		
		// Do not need -> Log is in SetPlayerLoad
		//PrintString(ToString(this) + "'s load weight is " + ToString(m_CargoLoad) + " g.");
	}

	void CalculatePlayerLoad()
	{
		EntityAI attachment;
		ItemBase itemHands;
		
		itemHands = GetItemInHands();
		int attcount = this.GetInventory().AttachmentCount();
		int total_load = 0;
		
		for (int att = 0; att < attcount; att++)
		{	
			attachment = GetInventory().GetAttachmentFromIndex(att);
			if( attachment )
			{
				total_load += attachment.GetItemWeight();
			}
		}

		if ( itemHands ) // adds weight of item carried in hands
			total_load += itemHands.GetItemWeight();

		SetPlayerLoad(total_load);
	}

 

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


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

BorizzK crash

Can't compile mission init script'!

$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c(275): Can't find variable 'm_CargoLoad'

init.c

	override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
	{
		Entity playerEnt;
		playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
		Class.CastTo(m_player, playerEnt);
		
		 g_Game.SendMessage(
         false,
         identity,
         "Server Login:",
         "Welcome "+identity.GetName() + ", enjoy your stay! Please make sure to read our rules! Trader Located Green Mountain And Kumyrna!!",
         10,
         2,
         false,
         true,
         "",
         0,
         0);
        GetGame().SelectPlayer(identity, m_player);
		return m_player;
		
	}
	
    float GetPlayerLoad()
	{
		return m_CargoLoad;
	}
	
	bool IsOverloaded()
	{
		if ( GetPlayerLoad() >= OVERLOAD_LIMIT ) return true;
		return false;
	}

	void SetPlayerLoad(float load)
	{
		m_CargoLoad = load;
		
		//Log(ToString(this) + "'s load weight is " + ftoa(m_CargoLoad) + " g.", LogTemplates.TEMPLATE_PLAYER_WEIGHT);
	}

	void AddPlayerLoad(float addedload)
	{
		float newload = GetPlayerLoad() + addedload;
		SetPlayerLoad(newload);
		
		// Do not need -> Log is in SetPlayerLoad
		//PrintString(ToString(this) + "'s load weight is " + ToString(m_CargoLoad) + " g.");
	}

	void CalculatePlayerLoad()
	{
		EntityAI attachment;
		ItemBase itemHands;
		
		itemHands = GetItemInHands();
		int attcount = this.GetInventory().AttachmentCount();
		int total_load = 0;
		
		for (int att = 0; att < attcount; att++)
		{	
			attachment = GetInventory().GetAttachmentFromIndex(att);
			if( attachment )
			{
				total_load += attachment.GetItemWeight();
			}
		}

		if ( itemHands ) // adds weight of item carried in hands
			total_load += itemHands.GetItemWeight();

		SetPlayerLoad(total_load);
	}

	 override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;
		float rand;
		
		itemTop = player.FindAttachmentBySlotName("Body");
		
		if ( itemTop )
		{
			itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(4);

			SetRandomHealth(itemEnt);
			
			itemEnt = itemTop.GetInventory().CreateInInventory("RoadFlare");
			SetRandomHealth(itemEnt);
			
			rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory("Apple");
			else if ( rand > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory("Pear");
			else
				itemEnt = player.GetInventory().CreateInInventory("Plum");
		
			SetRandomHealth(itemEnt);
		}
	}
        
};

 

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


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

BorizzK dta\scripts\4_World\Entities\ManBase\PlayerBase.c ??

change Warning signature!

20190815205610_1jnjlt.jpg

Изменено пользователем hooligan334 (история изменений)

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


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

hooligan334 don't change and replase original scripts pbo and folder, use only server mods, game is very bugged

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


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

123new ok I solved the problem :)

 

Do you know how to spawn a given class name on a given cords?

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
7 часов назад, hooligan334 сказал:

123new  and where I have it write??

as sample add this function

void SpawnObject( string type, vector position, vector orientation )
{
  auto obj = GetGame().CreateObject( type, "0 0 0" );
  if(obj)
  {
	obj.SetPosition( position );
	obj.SetOrientation( orientation );
	Print("[SpawnObject] Object='" + obj.GetType()  + "' in position='" + obj.GetPosition().ToString() + "' and with orientation='" + obj.GetOrientation().ToString() + "' has been spawned successfull!");
  } else
  {
      Print("[SpawnObject] Object='" + type + "' in position='" + position.ToString() + "' and with orientation='" + orientation.ToString() + "' don't spawned!");
  }
}

and use him with his command

SpawnObject( "OffroadHatchback", "14760.700195 34.657902 13322.099609", "0.000000 0.000000 0.000000" );
SpawnObject( "AK101", "14760.700195 34.657902 13322.099609", "0.000000 0.000000 0.000000" );

 

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
1 час назад, hooligan334 сказал:

123new and after rebooting won't double the items?

no, its will be

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


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

123new 

SpawnObject( "OffroadHatchback", "14760.700195 34.657902 13322.099609", "0.000000 0.000000 0.000000" );
SpawnObject( "AK101", "14760.700195 34.657902 13322.099609", "0.000000 0.000000 0.000000" );

add init.c?

 

//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
  auto obj = GetGame().CreateObject( type, "0 0 0" );
  if(obj)
  {
	obj.SetPosition( position );
	obj.SetOrientation( orientation );
	Print("[SpawnObject] Object='" + obj.GetType()  + "' in position='" + obj.GetPosition().ToString() + "' and with orientation='" + obj.GetOrientation().ToString() + "' has been spawned successfull!");
  } else
  {
      Print("[SpawnObject] Object='" + type + "' in position='" + position.ToString() + "' and with orientation='" + orientation.ToString() + "' don't spawned!");
  }
}

void main()
{
SpawnObject( "OffroadHatchback", "14760.700195 34.657902 13322.099609", "0.000000 0.000000 0.000000" );

 

Изменено пользователем hooligan334 (история изменений)

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


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

123new 

add

void main()
{
    SpawnObject( "FAL", "4696.08 7 2405.24", "0.000000 0.000000 0.000000" );

 

loock. I made 3 restarts,doubled the items why ?

https://steamuserimages-a.akamaihd.net/ugc/791991838187879570/8C4EF4476CACE21C70C67CAFAD2E0BD6F93E1CCA/

 

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


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

hooligan334 because in every start server will be runned command

 SpawnObject( "FAL", "4696.08 7 2405.24", "0.000000 0.000000 0.000000" );

and a new copy object will be spawned.

 

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


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

123new 

how to remove these items after rebooting??

void loot()
{
//Your custom spawned objects
SpawnObject( "CamoNetShelter", "14076.541992 136.752670 14976.748047", "137.618942 0.000000 0.000000" );
SpawnObject( "SeaChest", "14075.116211 136.884155 14978.248047", "50.000004 0.000000 -4.890675" );
SpawnObject( "AK101", "14076.048828 137.054703 14978.978516", "151.460526 85.055412 -45.103710" );
SpawnObject( "AK101", "14076.253906 137.067352 14978.034180", "-178.111877 83.078133 95.316048" );
SpawnObject( "AK101", "14073.862305 136.909302 14977.678711", "1.888104 -83.078133 -127.007103" );
SpawnObject( "AK101", "14074.860352 136.838364 14976.963867", "26.565048 -89.486038 -44.056740" );
SpawnObject( "AK101", "14073.970703 137.166077 14979.407227", "1.888104 -83.078133 -15.931926" );
SpawnObject( "TacticalGloves_Green", "14075.659180 136.773331 14978.079102", "104.140404 -1.475789 6.763414" );
SpawnObject( "JungleBoots_Green", "14075.958008 137.148819 14982.344727", "102.247910 -3.234643 3.741717" );
SpawnObject( "JungleBoots_Green", "14071.146484 136.822861 14978.212891", "-28.928053 5.952151 -3.539577" );
SpawnObject( "BDUJacket", "14075.393555 137.077988 14980.287109", "-37.583660 4.883367 -0.776322" );
SpawnObject( "BDUJacket", "14072.715820 136.705734 14977.149414", "162.402802 -0.367610 0.357007" );
SpawnObject( "UKAssVest_Khaki", "14077.089844 136.798172 14978.388672", "55.605129 0.505675 4.918680" );
};

 

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


Ссылка на сообщение
Поделиться на других сайтах
  • 0
4 часа назад, hooligan334 сказал:

123new 

how to remove these items after rebooting??


void loot()
{
//Your custom spawned objects
SpawnObject( "CamoNetShelter", "14076.541992 136.752670 14976.748047", "137.618942 0.000000 0.000000" );
SpawnObject( "SeaChest", "14075.116211 136.884155 14978.248047", "50.000004 0.000000 -4.890675" );
SpawnObject( "AK101", "14076.048828 137.054703 14978.978516", "151.460526 85.055412 -45.103710" );
SpawnObject( "AK101", "14076.253906 137.067352 14978.034180", "-178.111877 83.078133 95.316048" );
SpawnObject( "AK101", "14073.862305 136.909302 14977.678711", "1.888104 -83.078133 -127.007103" );
SpawnObject( "AK101", "14074.860352 136.838364 14976.963867", "26.565048 -89.486038 -44.056740" );
SpawnObject( "AK101", "14073.970703 137.166077 14979.407227", "1.888104 -83.078133 -15.931926" );
SpawnObject( "TacticalGloves_Green", "14075.659180 136.773331 14978.079102", "104.140404 -1.475789 6.763414" );
SpawnObject( "JungleBoots_Green", "14075.958008 137.148819 14982.344727", "102.247910 -3.234643 3.741717" );
SpawnObject( "JungleBoots_Green", "14071.146484 136.822861 14978.212891", "-28.928053 5.952151 -3.539577" );
SpawnObject( "BDUJacket", "14075.393555 137.077988 14980.287109", "-37.583660 4.883367 -0.776322" );
SpawnObject( "BDUJacket", "14072.715820 136.705734 14977.149414", "162.402802 -0.367610 0.357007" );
SpawnObject( "UKAssVest_Khaki", "14077.089844 136.798172 14978.388672", "55.605129 0.505675 4.918680" );
};

 

need add a few check this loot in position ando a new spawn, or use official system loot server with types.xml

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


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

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

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

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

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

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

Войти

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

Войти сейчас

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

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

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