๐ชox_doorlock usage
Unfortunately, ox_doorlock does not provide functions that will help us grant doorlock access to a member of the organization, so one solution may be to use it as follows.
Go to
pp-orgpanel/server/editable/frameworkand find this
RegisterNetEvent('esx:playerLoaded', function(player, xPlayer, isNew)
[...]
end)Change this part of code to something like this
if interiorsResult and #interiorsResult > 0 then
local orgDoorlock = interiorsResult[1].doorlock
Player(xPlayer.source).state.orgDoorlock = orgDoorlock
endBelow the
playerLoadedevent, add something like this to keep the door lock system in sync.
RegisterNetEvent('pp-orgpanel:memberAdded', function(orgId, sourceId, targetId)
MySQL.Async.fetchAll('SELECT doorlock FROM organization_interiors WHERE org_id = @org_id', {
['@org_id'] = orgId
}, function(interiorsResult)
if interiorsResult and #interiorsResult > 0 then
local orgDoorlock = interiorsResult[1].doorlock
Player(targetId).state.orgDoorlock = orgDoorlock
end
end)
end)
RegisterNetEvent('pp-orgpanel:memberFired', function(targetId)
Player(targetId).state.orgDoorlock = nil
end)
RegisterNetEvent('pp-orgpanel:memberLeaved', function(orgId, targetId)
Player(targetId).state.orgDoorlock = nil
end)Now go to
ox_doorlock/server/framework/es_extendedfind theIsPlayerInGroupfunction and replace it with this
Now set the interior doorlock in
pp-orgpanel/config_c/Config.interiorsto the same name as the group in the doorlock settings, for example:

Restart your server and everything should work great now
Was this helpful?