mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
42
gamemodes/ixhl2rp/plugins/willarddoors/sv_plugin.lua
Normal file
42
gamemodes/ixhl2rp/plugins/willarddoors/sv_plugin.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
--[[
|
||||
| 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")
|
||||
Reference in New Issue
Block a user