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
Subility

Перевозка бочек с лутом в машине

Искал по форуму, но что-то ничего похожего не нашел.

 

Подскажите, есть ли возможность сделать так, чтобы в тачку можно было положить бочку с лутом, да в идеале и рюкзаки тоже? Может мод есть какой-то на это?

Я так понимаю можно сделать атачменты как у в3с, но это уже перебор. Мне бы их именно в инвентарь класть.

 

Всем заранее спасибо за любую помощь!

Edited by Subility (see edit history)

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
51 минуту назад, Archon7th сказал:

modded class Barrel_ColorBase { bool IsCarOpenedAttachment(EntityAI parent) { if (parent.IsInherited(Truck_01_Covered) || parent.IsKindOf("BuhankaKuznecov")) return true; return false; } override bool CanDetachAttachment(EntityAI parent) { CarScript car; if (Class.CastTo(car, parent)) { if (GetNumberOfItems() > 0) { return false; } return parent.CanReleaseAttachment(this); } return super.CanDetachAttachment(parent); } override bool CanReleaseCargo(EntityAI cargo) { EntityAI root = GetHierarchyRoot(); if (root && IsCarOpenedAttachment(root)) return root.CanReleaseCargo(cargo); return super.CanReleaseCargo(cargo); } override bool CanReceiveItemIntoCargo(EntityAI item) { EntityAI root = GetHierarchyRoot(); if (root && IsCarOpenedAttachment(root)) return true; return super.CanReceiveItemIntoCargo(item); } override bool CanLoadItemIntoCargo(EntityAI item) { EntityAI root = GetHierarchyRoot(); if (root && IsCarOpenedAttachment(root)) return true; return super.CanLoadItemIntoCargo(item); } override bool CanDisplayCargo() { EntityAI root = GetHierarchyRoot(); if (root && IsCarOpenedAttachment(root)) return root.CanDisplayCargo(); return super.CanDisplayCargo(); } }


modded class Barrel_ColorBase
{

	bool IsCarOpenedAttachment(EntityAI parent) {
		if (parent.IsInherited(Truck_01_Covered) || parent.IsKindOf("BuhankaKuznecov"))
			return true;

		return false;
	}

	override bool CanDetachAttachment(EntityAI parent)
	{
		CarScript car;
		if (Class.CastTo(car, parent))
		{
			if (GetNumberOfItems() > 0) {
				return false;
			}
			return parent.CanReleaseAttachment(this);
		}
		return super.CanDetachAttachment(parent);
	}

	override bool CanReleaseCargo(EntityAI cargo)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return root.CanReleaseCargo(cargo);

		return super.CanReleaseCargo(cargo);
	}



	override bool CanReceiveItemIntoCargo(EntityAI item)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return true;

		return super.CanReceiveItemIntoCargo(item);
	}

	override bool CanLoadItemIntoCargo(EntityAI item)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return true;

		return super.CanLoadItemIntoCargo(item);
	}

	override bool CanDisplayCargo()
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return root.CanDisplayCargo();

		return super.CanDisplayCargo();
	}
}

перечисли классы машин в IsCarOpenedAttachment в которых это должно работать
учти, это клиент мод, одним сервермодом тут не обойтись

ну и соответвенно нужно отмодить тачки, добавить им атечмент бочку
"Truck_01_Barrel1","Truck_01_Barrel2","Truck_01_Barrel3","Truck_01_Barrel4"

 

зачем все эти сложности??? можно же проще сделать, и не нужно каждый класс машины модить

modded class Barrel_ColorBase : DeployableContainer_Base
{

	override bool CanPutInCargo( EntityAI parent )
	{
		if ( !super.CanPutInCargo( parent ))
			return true; // бочку можно класть в инветарь с лутом

		if ( GetNumberOfItems() == 0 && !IsOpen() )
			return true;

		return false;
	}
	
	override bool CanPutIntoHands( EntityAI parent )
	{
		if ( !super.CanPutIntoHands( parent ))
			return true; // бочку можно брать в руки с лутом

		if ( GetNumberOfItems() == 0 && (GetInventory().IsAttachment() || !IsOpen()) )
			return true;

		return false;
	}
};

 

Edited by Dima198901 (see edit history)

Share this post


Link to post
Share on other sites



  • 0
35 минут назад, Dima198901 сказал:

это тебе нужно модить класс экшена ActionGetInTransport

Спасибо хоть за направление )))

Share this post


Link to post
Share on other sites
  • 0

Тебе просто нужно отмодить класс самой бочки, дать разрешение класть в инвентарь бочку с лутом. Но учти, что начнут багоюзить игроки и класть бочка, в бочку.

Share this post


Link to post
Share on other sites
  • 0
modded class Barrel_ColorBase
{

	bool IsCarOpenedAttachment(EntityAI parent) {
		if (parent.IsInherited(Truck_01_Covered) || parent.IsKindOf("BuhankaKuznecov"))
			return true;

		return false;
	}

	override bool CanDetachAttachment(EntityAI parent)
	{
		CarScript car;
		if (Class.CastTo(car, parent))
		{
			if (GetNumberOfItems() > 0) {
				return false;
			}
			return parent.CanReleaseAttachment(this);
		}
		return super.CanDetachAttachment(parent);
	}

	override bool CanReleaseCargo(EntityAI cargo)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return root.CanReleaseCargo(cargo);

		return super.CanReleaseCargo(cargo);
	}



	override bool CanReceiveItemIntoCargo(EntityAI item)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return true;

		return super.CanReceiveItemIntoCargo(item);
	}

	override bool CanLoadItemIntoCargo(EntityAI item)
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return true;

		return super.CanLoadItemIntoCargo(item);
	}

	override bool CanDisplayCargo()
	{
		EntityAI root = GetHierarchyRoot();

		if (root && IsCarOpenedAttachment(root))
			return root.CanDisplayCargo();

		return super.CanDisplayCargo();
	}
}

перечисли классы машин в IsCarOpenedAttachment в которых это должно работать
учти, это клиент мод, одним сервермодом тут не обойтись

ну и соответвенно нужно отмодить тачки, добавить им атечмент бочку
"Truck_01_Barrel1","Truck_01_Barrel2","Truck_01_Barrel3","Truck_01_Barrel4"

 

Edited by Archon7th
доп данные (see edit history)

Share this post


Link to post
Share on other sites
  • 0
05.12.2023 в 21:08, Dima198901 сказал:

зачем все эти сложности??? можно же проще сделать, и не нужно каждый класс машины модить

modded class Barrel_ColorBase : DeployableContainer_Base { override bool CanPutInCargo( EntityAI parent ) { if ( !super.CanPutInCargo( parent )) return true; // бочку можно класть в инветарь с лутом if ( GetNumberOfItems() == 0 && !IsOpen() ) return true; return false; } override bool CanPutIntoHands( EntityAI parent ) { if ( !super.CanPutIntoHands( parent )) return true; // бочку можно брать в руки с лутом if ( GetNumberOfItems() == 0 && (GetInventory().IsAttachment() || !IsOpen()) ) return true; return false; } };


modded class Barrel_ColorBase : DeployableContainer_Base
{

	override bool CanPutInCargo( EntityAI parent )
	{
		if ( !super.CanPutInCargo( parent ))
			return true; // бочку можно класть в инветарь с лутом

		if ( GetNumberOfItems() == 0 && !IsOpen() )
			return true;

		return false;
	}
	
	override bool CanPutIntoHands( EntityAI parent )
	{
		if ( !super.CanPutIntoHands( parent ))
			return true; // бочку можно брать в руки с лутом

		if ( GetNumberOfItems() == 0 && (GetInventory().IsAttachment() || !IsOpen()) )
			return true;

		return false;
	}
};

 

Спасибо большое, очень выручил! Все работает как надо.

Edited by Subility (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

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