Reneb submitted a new resource:
Door Unlock/Lock - Unlock and lock doors, for admins and/or players
Read more about this resource...
Door Unlock/Lock [Unmaintained]
Discussion in 'Plugin Support' started by Reneb, Oct 27, 2014.
-
Nicely done Reneb! You're on fire today!
-
its a fail for me as it's not working the way i want
-
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 -
no i wanted to fix the bug where you can use door locks after a restart.
-
-
/remove XD
going to add a refund for locks when they are on doors -
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 -
HMMMMMMM
-
-
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 :/
-
How to use these commands?
What to do? -
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 -
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
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
-
Very Nice
I maybe found another way also, but î didnt test it. I'll add your code if my way fails.
Thanks. -
I like to see this compatible with friends API
-
This is no longer working...nothing happens and nothing shown on console.
-
Wulf Community Admin
-
-
Reneb updated Door Unlock/Lock with a new update entry:
update for new version & friends support