Solved Switching on/off ceiling lights?
Discussion in 'Rust Development' started by miRror, Nov 10, 2016.
-
Wulf Community Admin
You don't need a hook to toggle lights, Oxide hooks are events that trigger code.
-
He need to block ability to turning ON and OFF on ceilings for every player, cuz he have lobby, where players switching on and off lights.
-
Wulf Community Admin
Okay, that's something Rust would be provide, not an Oxide hook. -
No hook? No way to start light and nothing can switch it off? Maybe any parameter? Thanks.
-
Wulf Community Admin
A hook is something that Oxide calls in plugins to run code once that area is triggered by the game. You do not need a hook, you need to look in Rust's code to see how to turn lights on and off, and put that inside an existing hook or command where you want to use it.
Open a .NET decompiler, open Rust's Assembly-CSharp.dll inside it, look for code related to lights and attempt to use it. -
Wulf Community Admin
Yes, you can run that, there'd be no point in a hook for what you want. You are wanting to trigger, not listen. -
@Wulf, Sorry, I badly speak English and I will use the translator. Players by means of a bucket extinguish lamps. I want to forbid them to do it.
http://dl1.joxi.net/drive/2016/11/10/0003/0441/229817/17/4f8cab35f6.png -
Wulf Community Admin
Okay, so you do want to listen for and prevent players from turning lights off? -
@Wulf, "prevent players from turning lights off"
-
Calytic Community Admin Community Mod
Technically a CeilingLight is an Oven
So you might try..
Code:object OnOvenToggle(BaseOven oven, BasePlayer player) { if(oven is CeilingLight) { return false; } return null; } -
Works, but how to block shutdown by means of a bucket
