mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
43 lines
1.1 KiB
Lua
43 lines
1.1 KiB
Lua
--[[
|
|
| This file was obtained through the combined efforts
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
|
|
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
|
|
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
|
--]]
|
|
|
|
local PLUGIN = PLUGIN
|
|
|
|
ix.char.RegisterVar("ownedDoors", {
|
|
field = "OwnedDoors",
|
|
fieldType = ix.type.array,
|
|
default = {},
|
|
bNoDisplay = true,
|
|
OnSet = function(character, value)
|
|
if (character.vars.ownedDoors) then
|
|
table.insert(
|
|
character.vars.ownedDoors,
|
|
#character.vars.ownedDoors + 1,
|
|
value
|
|
)
|
|
else
|
|
character.vars.ownedDoors = {value}
|
|
end
|
|
end,
|
|
OnGet = function(character, _)
|
|
return character.vars.ownedDoors or {}
|
|
end
|
|
})
|
|
|
|
function PLUGIN:CanPlayerAccessDoor(client, door, access)
|
|
for _, v in ipairs(client:GetCharacter():GetOwnedDoors()) do
|
|
if (v == door:EntIndex()) then
|
|
return true
|
|
end
|
|
end
|
|
end
|
|
|
|
util.AddNetworkString("OnDoorPrintOwners")
|