Solved Block elevator blocks

Discussion in 'Plugin Requests' started by CHR, Mar 2, 2015.

  1. CHR

    CHR

    Hey Guys,

    On my PvP People would like to have Elevator Blocking

    Hope People know what i mean.

    U place a Block Jump Block Jump Block Jump the normal way to build up for a raid... can we stop this somehow?
     
  2. CHR

    CHR

    No possability?

    It's fine to build diving boards I just wanna delay the time they need to build up. Come on guys.
     
  3. Might add this as a plugin later but I haven't been able to test this on a live server so I have no idea how it will go on an active server, basically what it does is blocking the player from building anything while he is jumping or when the player is too close to the build location.
     

    Attached Files:

  4. CHR

    CHR

    AMAZING i Try it out and tell u how ist going
    [DOUBLEPOST=1425918713,1425909535][/DOUBLEPOST]U must release it as a official Plugin it works Perfect :)
     
  5. I totally forgot about this to be honest :p
    I have added it to the resources and should appear there once it has been approved.
     
  6. yes it should be publish several months ago

    it's really perfect man

    already 16player left my server :) but doesnt matter!
     
  7. CHR

    CHR

    It just delays the build of towers. But it works.
     
  8. Are you able to extend this by denying building on top of other people? This can still be done as a two man job, although they won't be able to build -that- far up.
     
  9. I'll see what I can do when I have some time.
     
  10. BlockBlockElevators.cs
    Code:
    // Reference: Oxide.Ext.Rustusing System.Collections.Generic;
    using System;
    using System.Reflection;
    using System.Data;
    using UnityEngine;
    using Oxide.Core;namespace Oxide.Plugins
    {
        [Info("BlockBlockElevators", "Reneb", "1.0.0")]
        class BlockBlockElevators : RustPlugin
        {        BuildingBlock cachedBlock;
            TriggerBase cachedTrigger;
            BasePlayer cachedPlayer;
            int playerMask;
            int blockLayer;
            int triggerLayer;        bool hasStarted = false;        void OnServerInitialized()
            {
                hasStarted = true;
                playerMask = LayerMask.GetMask(new string[] { "Player (Server)" });
                triggerLayer = UnityEngine.LayerMask.NameToLayer("Trigger");
                blockLayer = UnityEngine.LayerMask.NameToLayer("Construction");
            }        void OnEntityBuilt(Planner planner, GameObject gameObject)
            {
                cachedBlock = gameObject.GetComponent<BuildingBlock>();
                if (cachedBlock == null) return;
                if (cachedBlock.blockDefinition == null) return;
                if (cachedBlock.blockDefinition.fullName != "build/block.halfheight") return;
                cachedBlock.GetComponentInChildren<MeshCollider>().gameObject.AddComponent<TriggerBase>();
                cachedBlock.GetComponentInChildren<TriggerBase>().gameObject.layer = triggerLayer;
                cachedBlock.GetComponentInChildren<TriggerBase>().interestLayers = playerMask;
                timer.Once(0.1f, () => ResetBlock(cachedBlock) );        }
            void ResetBlock(BuildingBlock block)
            {
                if (block == null) return;
                GameObject.Destroy(block.GetComponentInChildren<TriggerBase>());
                block.gameObject.layer = blockLayer;
            }
            void OnEntityEnter(TriggerBase triggerbase, BaseEntity entity)
            {
                if (!hasStarted) return;
                cachedBlock = triggerbase.GetComponentInParent<BuildingBlock>();
                if (cachedBlock == null) return;
                if (cachedBlock.blockDefinition.fullName != "build/block.halfheight") return;
                cachedPlayer = entity.GetComponent<BasePlayer>();
                if (cachedPlayer == null) return;
                cachedBlock.KillMessage();
                cachedPlayer.SendConsoleCommand("chat.add", new object[] { "0", string.Format("<color=orange>{0}:</color> {1}", "Warning", "You are not allowed to build blocks over you"), 1.0 });
            }
        }
    }
     
  11. I think this is seperate plugin which need to be installed additionally
     
  12. Is it possible for someone to make a plugin that destroys twig objects placed on top of other twig objects? This will fix a lot of the elevator abuse.