Jump to content

Recommended Posts

Posted (edited)

Looking for a plugin to disable chinook dropping crates at monuments, train yard, power plant etc. I"m not talking about the large/small oil locked crates. I will pay.

Edited by jayinwww
Posted

This should work and prevent the crate from spawning without removing the chinook from the game
 

// https://codefling.com/ryuk_

using System;
using System.Collections.Generic;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("Chinook_Crate_Event", "Ryuk", "1.0.0")]
    class Chinook_Crate_Event : RustPlugin
    {
        void OnCrateDropped(HackableLockedCrate crate)
        {
            NextTick(() =>
            {
                if (crate != null && !crate.IsDestroyed)
                {
                    crate.Kill();
                }
            });
        }
    }
}

 

  • Like 1
Posted

Been looking for a plugin to disable it great thank you. Think there is a way to make shanook that you can shoot it down with a lockon rocket. Then it will drop its crate then for sure if it does not drop it an monuments or does this plugin not spawn it in the shanook? 

 

Posted

I got an error

o.reload Chinook_Crate_Event
Plugin filename Chinook_Crate_Event.cs must match the main class Chinook_Crate_Event (should be Chinook_Crate_Event.cs)
[CSharp] Started Oxide.Compiler v successfully
 was compiled successfully in 1183ms
Ignored unexpected plugin compilation failure: ChinookCrateEvent
Error while compiling Chinook_Crate_Event: Plugin filename Chinook_Crate_Event.cs must match the main class Chinook_Crate_Event (should be Chinook_Crate_Event.cs)

Posted
9 hours ago, GREAT PRETENDER said:

Been looking for a plugin to disable it great thank you. Think there is a way to make shanook that you can shoot it down with a lockon rocket. Then it will drop its crate then for sure if it does not drop it an monuments or does this plugin not spawn it in the shanook? 

 

This only works for removing the locked hackable crate when the chinook drops it. I don't know how to allow the players to lock the entity using the homing missile launcher sadly 😞

Posted
8 hours ago, jayinwww said:

I got an error

o.reload Chinook_Crate_Event
Plugin filename Chinook_Crate_Event.cs must match the main class Chinook_Crate_Event (should be Chinook_Crate_Event.cs)
[CSharp] Started Oxide.Compiler v successfully
 was compiled successfully in 1183ms
Ignored unexpected plugin compilation failure: ChinookCrateEvent
Error while compiling Chinook_Crate_Event: Plugin filename Chinook_Crate_Event.cs must match the main class Chinook_Crate_Event (should be Chinook_Crate_Event.cs)

Just replace the plugin name
Chinook_Crate_Event to ChinookCrate
i don't know why you get that error if the main class and the name is the same...
 

// https://codefling.com/ryuk_

using System;
using System.Collections.Generic;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("ChinookCrate", "Ryuk", "1.0.0")]
    [Description("Remove hackable crate when the chinook drops it.")]
    public class ChinookCrate : RustPlugin
    {
        void OnCrateDropped(HackableLockedCrate crate)
        {
            NextTick(() =>
            {
                if (crate != null && !crate.IsDestroyed)
                {
                    crate.Kill();
                }
            });
        }
    }
}

 

Posted (edited)

Okay to just make sure I understand correctly, I name the file ChinookCrate.cs

Having what you just posted in the file.

Edited by jayinwww
Posted
41 minutes ago, jayinwww said:

Okay to just make sure I understand correctly, I name the file ChinookCrate.cs

Having what you just posted in the file.

Yes, copy the latest code i sent and paste it into "ChinookCrate.cs"

 

Posted

Okay, just an update, it seems to be working, I haven't seen the Chinook drop crates at monuments which is great, but cargo also doesn't have any locked crates. Is there anyway to fix that?

Posted
7 hours ago, jayinwww said:

Any update? Will pay.

using System;
using System.Collections.Generic;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("ChinookCrate", "Ryuk", "1.0.0")]
    [Description("Remove hackable crate when the chinook drops it.")]
    public class ChinookCrate : RustPlugin
    {
        void OnCrateDropped(HackableLockedCrate crate)
        {
            NextTick(() =>
            {
                if (crate != null && !crate.IsDestroyed)
                {
                    if (IsChinookNearby(crate.transform.position, 20f))
                    {
                        crate.Kill();
                    }
                }
            });
        }

        private bool IsChinookNearby(Vector3 position, float radius)
        {
            var entities = new List<BaseEntity>();
            Vis.Entities(position, radius, entities, Rust.Layers.Mask.Vehicle_World);

            foreach (var entity in entities)
            {
                if (entity is CH47Helicopter)
                {
                    return true;
                }
            }
            return false;
        }
    }
}

 

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
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.8k

Files Sold

Total number of files sold.

2.1m

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.