Exportlar
DS-ServerCreator exposes server-side exports that let your own resources reuse the permissions, doorlock, multijob, and robbery systems configured in the in-game panel.
Permissions
HasPermission
serverChecks whether a player can use one configured Server Creator action. Global actions and permissions assigned to the player’s current job are both considered.
İmza
exports['DS-ServerCreator']:HasPermission(playerId, permission)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| playerId | number | The player’s server ID. |
| permission | string | Permission key, such as handcuff, drag, billing, revive, or check_identity. |
Döndürür
true when the action is allowed, otherwise false.
Örnek
if exports['DS-ServerCreator']:HasPermission(source, 'handcuff') then
-- The player can use the handcuff action
endGetPlayerPermissions
serverReturns the player’s effective permission map after merging job permissions with globally enabled actions.
İmza
exports['DS-ServerCreator']:GetPlayerPermissions(playerId)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| playerId | number | The player’s server ID. |
Döndürür
A table keyed by permission name. Returns an empty table when no permissions apply or the player ID is invalid.
Örnek
local permissions = exports['DS-ServerCreator']:GetPlayerPermissions(source)
if permissions.billing then
-- Show the billing option
endIsPlayerHandcuffed
clientChecks the local client state and returns whether the local player is currently handcuffed by Server Creator.
İmza
exports['DS-ServerCreator']:IsPlayerHandcuffed()Döndürür
true while the local player is handcuffed, otherwise false.
Örnek
if exports['DS-ServerCreator']:IsPlayerHandcuffed() then
-- Block an action for the local cuffed player
endIsPlayerHandcuffed
serverChecks whether a specific player is currently handcuffed by Server Creator’s built-in permission actions.
İmza
exports['DS-ServerCreator']:IsPlayerHandcuffed(playerId)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| playerId | number | The player’s server ID. |
Döndürür
true while the player is handcuffed, otherwise false.
Örnek
if exports['DS-ServerCreator']:IsPlayerHandcuffed(targetId) then
print('The player is handcuffed')
endDoorlocks
GetDoorState
serverReads the authoritative live state of a built-in Server Creator doorlock.
İmza
exports['DS-ServerCreator']:GetDoorState(reference)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| reference | number | string | The numeric database ID or the stable door name configured in the panel. |
Döndürür
locked or unlocked. If the door does not exist, returns nil followed by door_not_found.
Örnek
local state, errorCode = exports['DS-ServerCreator']:GetDoorState('bank_vault')
if state == 'locked' then
print('The vault is locked')
endSetDoorState
serverSets a door’s live state, synchronizes every client, fires the configured toggle hook, and arms autolock when applicable.
İmza
exports['DS-ServerCreator']:SetDoorState(reference, newState)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| reference | number | string | The numeric database ID or the stable door name configured in the panel. |
| newState | string | The new state: locked or unlocked. |
Döndürür
A success boolean followed by the resulting state, or an error code on failure.
Örnek
local success, stateOrError = exports['DS-ServerCreator']:SetDoorState('bank_vault', 'unlocked')ToggleDoor
serverSwitches a door between locked and unlocked using the same authoritative synchronization as normal interactions.
İmza
exports['DS-ServerCreator']:ToggleDoor(reference)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| reference | number | string | The numeric database ID or the stable door name configured in the panel. |
Döndürür
A success boolean followed by the resulting state, or an error code on failure.
Örnek
local success, stateOrError = exports['DS-ServerCreator']:ToggleDoor('bank_vault')Multijob
GetPlayerJobs
serverReturns every job held by a player, enriched with job and grade labels. Offline lookups are supported when you pass an identifier.
İmza
exports['DS-ServerCreator']:GetPlayerJobs(player)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| player | number | string | An online player server ID, or a framework identifier for an offline lookup. |
Döndürür
An array containing job_name, job_grade, is_active, job_label, and grade_label.
Örnek
local jobs = exports['DS-ServerCreator']:GetPlayerJobs(source)
for _, job in ipairs(jobs) do
print(job.job_name, job.job_grade, job.is_active)
endHasPlayerJob
serverChecks whether a player holds a job, optionally requiring a minimum grade.
İmza
exports['DS-ServerCreator']:HasPlayerJob(player, jobName, minimumGrade)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| player | number | string | An online player server ID, or a framework identifier for an offline lookup. |
| jobName | string | The internal job name, for example police. |
| minimumGrade? | number | Optional minimum grade. Omit it to accept any grade for the job. |
Döndürür
true when the player holds the requested job and meets the grade requirement.
Örnek
if exports['DS-ServerCreator']:HasPlayerJob(source, 'police', 2) then
-- The player holds police grade 2 or higher
endRobberies
GetRobberies
serverReturns all robbery definitions using the same client-safe schema sent to regular players.
İmza
exports['DS-ServerCreator']:GetRobberies()Döndürür
An array of sanitized robbery definitions, including public steps, markers, blips, and sounds.
Örnek
local robberies = exports['DS-ServerCreator']:GetRobberies()
for _, robbery in ipairs(robberies) do
print(robbery.id, robbery.name, robbery.enabled)
endIsRobberyActive
serverChecks whether a robbery currently has an active runtime session.
İmza
exports['DS-ServerCreator']:IsRobberyActive(robberyId)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| robberyId | number | The numeric robbery ID shown in the Server Creator panel. |
Döndürür
true while the robbery is reserved or in progress, otherwise false.
Örnek
if exports['DS-ServerCreator']:IsRobberyActive(1) then
print('Robbery #1 is in progress')
endGetRobberyState
serverReturns the public live state of one robbery, including its state, current step, participant count, looted props, and remaining cooldown.
İmza
exports['DS-ServerCreator']:GetRobberyState(robberyId)Parametreler
| Ad | Tip | Açıklama |
|---|---|---|
| robberyId | number | The numeric robbery ID shown in the Server Creator panel. |
Döndürür
The live-state table, or nil when the robbery ID does not exist.
Örnek
local state = exports['DS-ServerCreator']:GetRobberyState(1)
if state then
print(state.state, state.currentStep, state.cooldownRemaining)
endGetRobberies never exposes keypad codes, reward tables, alert chances, or other server-only values. Returned tables are copies, so changing them cannot modify Server Creator’s internal state.