Jump to content

Bug with Jetpack from David

Closed 0.1.0 0.1.1

Kobani
Kobani

Posted (edited)

If you wear Adem's jetpack (not David 😅 ) Plugin and then take it off again, the display no longer disappears.
And an empty display is added. This only disappears when I unload AdvanceStatus and load it again

20240510200212_1.jpg

Edited by Kobani
IIIaKa

Posted (edited)

Could you please check if there are any error logs related to the AdvancedStatus or FuelStatus plugins?
It seems that when equipping the Jetpack, the OnEntityMounted triggers, but when removing it, the OnEntityDismounted does not trigger, causing the plugins to believe that it is still mounted.

Edited by IIIaKa
IIIaKa

Posted

Try creating a file named Test.cs in the plugins folder and add the code below:

using System;

namespace Oxide.Plugins
{
	[Info("Test", "Test", "0.1.0")]
	class Test : RustPlugin
	{
		void OnEntityMounted(BaseMountable mount, BasePlayer player)
		{
			Puts($"{player.displayName} mounted {mount.name}");
		}

		void OnEntityDismounted(BaseMountable mount, BasePlayer player)
		{
			Puts($"{player.displayName} dismounted {mount.name}");
		}
	}
}


Then, equip the Jetpack and remove it.
You should see something like this printed to the console:

Quote

[Test] IIIaKa mounted assets/prefabs/vehicle/seats/minihelipassenger.prefab
[Test] IIIaKa dismounted assets/prefabs/vehicle/seats/minihelipassenger.prefab


 

Kobani

Posted

I apologise for only getting back to you now, I had not received a message.
I'll test it right away.

Kobani

Posted

I only receive one message. When equipping. Nothing happens when I discard.
[Test] Kobani mounted assets/prefabs/vehicle/seats/standingdriver.prefab

IIIaKa

Posted

This indicates that when equipping the Jetpack, the OnEntityMounted hook triggers, but when unequipping, the OnEntityDismounted hook does not trigger. Therefore, plugins assume that you are still wearing the Jetpack.

Since I haven't purchased the plugin, I'm unable to open a thread in the support section of the Jetpack plugin. Could you open a thread there?

  • Like 1
Kobani

Posted

With pleasure. Could you tell me what exactly I should post there or what I should post there for you? My English is not the best.

 

Kobani

Posted

I've written to Adem, I'll let you know when he replies

 

IIIaKa

Posted

Strange, I somehow can't reply in that thread. I'll message him privately then.

  • Like 1
Kobani

Posted

Have you been able to find out anything yet?

IIIaKa

Posted

Hi, Adem said he'll try to fix this.

IIIaKa

Posted

Changed Status from Pending to Work in Progress

Kobani

Posted

Could you possibly add the possibility that Fuel Status ignores the JetPack plugin until Adem finds a solution?

IIIaKa

Posted

For this, I need to somehow identify him. You need to create a file named Test.cs and insert the code below. Then put on the Jetpack and provide the console output.

using System;

namespace Oxide.Plugins
{
	[Info("Test", "Test", "0.1.0")]
	class Test : RustPlugin
	{
		void OnEntityMounted(BaseMountable mount, BasePlayer player)
		{
			Puts($"{mount.GetParentEntity().GetType()}\n{mount.GetParentEntity().GetType().Name}\n{player.GetMountedVehicle().GetType()}");
		}
	}
}

 

Kobani

Posted (edited)

I get the following message, when I equip the jetpack

Failed to call hook 'OnEntityMounted' on plugin 'Test v0.1.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.Test.OnEntityMounted (BaseMountable mount, BasePlayer player) [0x00027] in <35cc3ff29f0b489487b18a88f4e72ac0>:0
at Oxide.Plugins.Test.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00032] in <35cc3ff29f0b489487b18a88f4e72ac0>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <795304323ac74a298b8ed190a1dfa739>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in <beb2b64691c64e2b95b99491bd85442c>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <beb2b64691c64e2b95b99491bd85442c>:0

 

Edited by Kobani
IIIaKa

Posted

Try this:
 

using System;

namespace Oxide.Plugins
{
	[Info("Test", "Test", "0.1.0")]
	class Test : RustPlugin
	{
		void OnEntityMounted(BaseMountable mount, BasePlayer player)
		{
			Puts($"START");
			var parent = mount.GetParentEntity();
			if (parent != null)
				Puts($"{parent.GetType()}\n{parent.GetType().Name}\n{parent.skinID}");
			var vehicle = player.GetMountedVehicle();
			if (vehicle != null)
				Puts($"{vehicle.GetType()}");
			Puts($"END");
		}
	}
}

 

  • Like 1
Kobani

Posted

[Test] Oxide.Plugins.JetPack+MovableDroppedItem
MovableDroppedItem
0

  • Like 1
IIIaKa

Posted

I will send the file in the PM

  • Like 1
Kobani

Posted

Thank you for your effort

 

IIIaKa

Posted

Changed Status from Work in Progress to Closed

Changed Fixed In to 0.1.1

IIIaKa

Posted

Hello, in update 0.1.1, I've added the ability to specify colors for any fuel level percentages, as well as text that will display when at 0%.
I've also added ignoring the Jetpack.

IIIaKa

Posted

If you have anything to add, feel free to write in this thread.

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

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.