1. Hello forum!

    Is there any hook to block ability to switch on/off ceiling lights? Thanks.
     
    Last edited by a moderator: Nov 10, 2016
  2. Wulf

    Wulf Community Admin

    You don't need a hook to toggle lights, Oxide hooks are events that trigger code.
     
  3. 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.
     
  4. Wulf

    Wulf Community Admin

    Okay, that's something Rust would be provide, not an Oxide hook.
     
  5. No hook? No way to start light and nothing can switch it off? Maybe any parameter? Thanks.
     
  6. Wulf

    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.
     
  7. @Wulf,
    https://pp.vk.me/c626122/v626122897/37493/twtWYpl0sts.jpg
     
  8. Wulf

    Wulf Community Admin

  9. Wulf

    Wulf Community Admin

  10. @Wulf, "prevent players from turning lights off"
     
  11. Calytic

    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;
    }
     
  12. Works, but how to block shutdown by means of a bucket