GET · api v1
A yes/no answer: may this member use something that belongs to a قطاع? Combines status, rank and hiring ban. Made for armories, garages, doors and uniforms.
جواب نعم أو لا: هل يحق للعضو يستخدم شيء تابع للقطاع؟ يجمع الحالة والرتبة ومنع التوظيف. مخصص للمستودعات والكراجات والأبواب والملابس.
| Name | Type | Required | Description |
|---|---|---|---|
target | Target | required | Who to read about: { source = 7 } for an online player, { discord = "..." } or { code = "P-12" }. |
faction | string | required | The in-game job name linked to the قطاع, e.g. "police". |
min_rank | number | optional | Lowest rank index allowed, as shown in Ranks & Promotions. |
allow_statuses | string[] | optional | Default { "active" }. Add "on_vacation" to let members on vacation in. |
res.data)| Name | Type | Description |
|---|---|---|
allowed | boolean | The answer. |
reason | string|nil | Why not: not_member | on_vacation | resigned | terminated | retired | rank_too_low | hiring_banned |
reason_label | string|nil | Arabic text you can show the player. |
rank | table|nil | { index, name } |
RegisterNetEvent('armory:open', function()
local src = source
local res = exports.OrcaBot_V3:Get('member.access', {
target = { source = src }, faction = 'police', min_rank = 3,
})
if res.ok and res.data.allowed then
OpenArmory(src)
elseif res.ok then
TriggerClientEvent('ox_lib:notify', src, { description = res.data.reason_label, type = 'error' })
end
end)
{
"ok": true,
"data": {
"allowed": false,
"reason": "rank_too_low",
"reason_label": "رتبتك أقل من المطلوب",
"rank": {
"index": 2,
"name": "جندي"
}
},
"meta": {
"action": "member.access",
"method": "GET",
"api": 1
}
}