1. Reneb submitted a new resource:

    Door Unlock/Lock - Unlock and lock doors, for admins and/or players

    Read more about this resource...
     
  2. Nicely done Reneb! You're on fire today!
     
  3. its a fail for me as it's not working the way i want :p
     
  4. Let me guess...you wanted to have doorshare when they press E. :)

    Well that is what I am doing and this is probably going to get me over the finish line. Whatever I come up with I will send your way. Thanks...you are a great contributor out here![DOUBLEPOST=1414443965][/DOUBLEPOST]and maybe not...LOL.

    Seems like we are missing a hook to be able to do this in an convenient manner...
     
    Last edited by a moderator: Oct 27, 2014
  5. no i wanted to fix the bug where you can use door locks after a restart.
     
  6. I assume you know the work-around for that?
     
  7. /remove XD
    going to add a refund for locks when they are on doors
     
  8. lol yeah!

    Well this in-game work around makes the doors functional and it works every single time. If you take a door all the way to level 6 this works best.

    Approach door and lock, select to unlock (E to unlock)
    Hit door with hatchet - it will drop to level 5 max and the door will be unlocked.
    Open door
    Close door
    select to lock door (with mouse and select lock door)
    Hit door with hammer to repair to level 6 - door will change back to level 6 texture
    and will be locked.

    This may give you some insight on how to fix it programatically.
     
    Last edited by a moderator: Oct 27, 2014
  9. HMMMMMMM
     
  10. So obviously the attack and build cycles do something to synch the lock status...wondering if the texture change on the attack and repair it was forces the lock to repaint to show proper status and color.
     
  11. i looked everywhere in the code, i see what happens, why when you hit and build it fixes, etc, but i still don't see a real fix for it :/
     
  12. How to use these commands?
    What to do?
     
  13. You look at the lock and you say /unlock or /lock[DOUBLEPOST=1414488699][/DOUBLEPOST]Could be used for players.
    I find the key system just horrible to use :X
     
  14. Thanks Reneb!
    This, friends and ownership allows for keyless and door sharing! Nice job on this one!

    Also guys to open for your friends in huge bases using this without share you can lock/unlock your door through most walls/floors as long as its in the centre of your vision.[DOUBLEPOST=1414578759,1414538334][/DOUBLEPOST]Hey Reneb,

    I added a little bit of code, basically now after server restart locks will still work using the command, the only thing that doesn't happen is the Red/Green of the lock, but now you shouldn't have to hit it to see/hide "Open Door". Hopefully it works for everyone! I hate them pesky keys :p


    Code:
    function PLUGIN:cmdUnlock( player, com, args )
        local authlevel = player:GetComponent("BaseNetworkable").net.connection.authLevel
        local neededlevel = self.Config.authLevelToUsePlugin
        if(authlevel and neededlevel and authlevel >= neededlevel) then
            local arr = util.TableToArray( { player.eyes:Ray()  } )
            local hits = UnityEngine.Physics.RaycastAll["methodarray"][1]:Invoke(nil,arr)
            local it = hits:GetEnumerator()
            local gotinfo = {}
            while (it:MoveNext()) do
                if(it.Current.collider:GetComponentInParent(global.DeployedItem._type)) then
                    local deployeditem = it.Current.collider:GetComponentInParent(global.DeployedItem._type)
                    if(not gotinfo[deployeditem]) then
                        gotinfo[deployeditem] = true
                        local name = ""
                        if(deployeditem:GetComponent("WorldItem").item and deployeditem:GetComponent("WorldItem").item.info.displayname == "Wooden Door") then
                            local item = deployeditem:GetComponent("WorldItem").item
                            if(self:CanLock(authlevel,deployeditem.deployerUserID,player.userID)) then
                                local slots = item.slots
                                local sl = slots:GetEnumerator()
                                while(sl:MoveNext()) do
                                    if(sl.Current.info.displayname == "Lock") then
                                        sl.Current:LockUnlock(false,player)
                                    end
                                end
                               
                                door = deployeditem:GetComponent("BuildingBlock")  -- Get the door
                               
                                door:InitializeAsFrame() --Set it as "frame"
                                door:StopBeingAFrame() --Remove it as "frame" causes door to update
                            else
                                player:ChatMessage("You are not allowed to unlock this lock, it's not your door")
                            end
                        end
                    end
                end
            end
        else
            player:ChatMessage("You are not allowed to use this command")
        end
    end
     
  15. Very Nice :)
    I maybe found another way also, but î didnt test it. I'll add your code if my way fails :).
    Thanks.
     
  16. I like to see this compatible with friends API
     
  17. This is no longer working...nothing happens and nothing shown on console.
     
  18. Wulf

    Wulf Community Admin

    He's working on fixing it, just a few hurdles with the Rust bugs.
     
  19. Yep fully understand...just making sure he is getting the feedback...thanks.