EasyRemove for Admins

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
CorrosionX submitted a new resource:

EasyRemove for Admins - Admins can now easily remove any building.

Features:
Remove any building part by hitting it.


Admin only, why? Because unlike legacy, owner info isnt stored in building parts anymore.

How to use:
Use /remove to turn on and /remove to turn off
Timer for 60 seconds auto shuts off
Read more about this resource...
 
  • Winner
Reactions: Louis

RedDevil6193

New Member
Member
Oct 11, 2014
20
2
3
38
How does this work again, i type /remove and then i hit something and it should be gone? cause i did that and it didnt work.
 

sendjes

New Member
Member
Sep 1, 2014
15
0
1
Denmark
Just tested it, and as the others, nothing happens, hope you'll find the error.

*EDIT* This is output from log when hitting an object:
Code:
MissingMemberException: 'BasePlayer' object has no attribute 'Admin'
 

-uK

New Member
Member
Aug 23, 2014
8
4
3
I can also confirm.
Here is the error.html logs

Code:
MissingMemberException: 'BasePlayer' object has no attribute 'Admin'
at IronPython.Runtime.Binding.PythonGetMemberBinder+FastErrorGet`1[System.Object].GetError (System.Runtime.CompilerServices.CallSite site, System.Object target, IronPython.Runtime.CodeContext context) [0x00000] in <filename unknown>:0

at Microsoft.Scripting.Interpreter.DynamicInstruction`3[System.Object,IronPython.Runtime.CodeContext,System.Object].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0

at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Internal_LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception, Object)
Pluton.Logger:LogException(Exception, Object)
Pluton.Plugin:Invoke(String, Object[])
Pluton.Plugin:OnBuildingPartAttacked(BuildingHurtEvent)
Pluton.<InstallHooks>c__AnonStorey2:<>m__10(BuildingHurtEvent)
System.Reactive.AnonymousObserver`1:Next(BuildingHurtEvent)
System.Reactive.AbstractObserver`1:OnNext(BuildingHurtEvent)
System.Reactive.Subjects.Subject`1:OnNext(BuildingHurtEvent)
Pluton.Hooks:EntityAttacked(BuildingBlock, HitInfo)
BuildingBlock:OnAttacked_Destroy(HitInfo)
BuildingBlock:OnAttacked(HitInfo)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
BasePlayer:DoAttackShared(HitInfo)
BasePlayer:OnAttack(Message)
Network.Node:Call(Message)
Network.Router:Route(Message)
Network.Server:ReceivedMessage(Message)
Network.Implementation.Lidgren.Server:Cycle()
ServerMgr:Update()

(Filename: Line: -1)
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
CorrosionX updated EasyRemove for Admins with a new update entry:

Added OPTIONAL instant build

added optional on hit fully build any building part while admin and remove is off.

Also added ability for everyone to instant build anything they place on the ground.

Both are optional, uncomment/remove the # infront of the one you want.

Python:
    def On_FrameDeployed(self, deployed): # if you want everyone to instant build on placement
        deployed.health = deployed.MaxHealth()
and

Python:
else:  # if you only want admins to instant build anything they hit...
Read the rest of this update entry...
 

coersum

Plugin Developer
Plugin Developer
Oct 9, 2014
77
5
8
47
Parts Unknown
For the insta build to work, you need to add a setter to Health in BuildingPart.cs
Python:
        public float Health {
            get {
                return buildingBlock.health;
            }
            set {
                buildingBlock.health = value;
            }
        }
And a getter for MaxHealth:
Python:
        public float MaxHealth {
            get {
                return buildingBlock.MaxHealth
            }
        }
Or make it indestructible maybe by making it a crazy number (pending testing)
 

coersum

Plugin Developer
Plugin Developer
Oct 9, 2014
77
5
8
47
Parts Unknown
They are not, but easy to do, made a mistake the MaxHealth is MaxHealth():
Python:
        public float MaxHealth {
            get {
                return buildingBlock.MaxHealth();
            }
        }
But using MaxHealth bugs a bit in the sense that if you try to hurt it (without remove), the server shows an outofindex warning, so setting it to 515 which is the current lvl 6 maxhealth of a wall built the normal way stops that warning.
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
They are not, but easy to do, made a mistake the MaxHealth is MaxHealth():
Python:
        public float MaxHealth {
            get {
                return buildingBlock.MaxHealth();
            }
        }
But using MaxHealth bugs a bit in the sense that if you try to hurt it (without remove), the server shows an outofindex warning, so setting it to 515 which is the current lvl 6 maxhealth of a wall built the normal way stops that warning.
cant you just set hp to maxhp on hit to make it invincible?

TY requested pull request :)
https://github.com/Notulp/Pluton/pull/23/files#diff-4c2ec8bcafa6b446df537cd9e5ba54ab