Server Creator·Exportlar

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.

Server-side exports
Call these exports from a server script. A client script cannot call them directly; trigger a secured server event in your resource when client interaction is required.

Permissions

HasPermission

server

Checks 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

Lua
exports['DS-ServerCreator']:HasPermission(playerId, permission)

Parametreler

AdTipAçıklama
playerIdnumberThe player’s server ID.
permissionstringPermission key, such as handcuff, drag, billing, revive, or check_identity.

Döndürür

boolean

true when the action is allowed, otherwise false.

Örnek

Lua
if exports['DS-ServerCreator']:HasPermission(source, 'handcuff') then
  -- The player can use the handcuff action
end

GetPlayerPermissions

server

Returns the player’s effective permission map after merging job permissions with globally enabled actions.

İmza

Lua
exports['DS-ServerCreator']:GetPlayerPermissions(playerId)

Parametreler

AdTipAçıklama
playerIdnumberThe player’s server ID.

Döndürür

table

A table keyed by permission name. Returns an empty table when no permissions apply or the player ID is invalid.

Örnek

Lua
local permissions = exports['DS-ServerCreator']:GetPlayerPermissions(source)
if permissions.billing then
  -- Show the billing option
end

IsPlayerHandcuffed

client

Checks the local client state and returns whether the local player is currently handcuffed by Server Creator.

İmza

Lua
exports['DS-ServerCreator']:IsPlayerHandcuffed()

Döndürür

boolean

true while the local player is handcuffed, otherwise false.

Örnek

Lua
if exports['DS-ServerCreator']:IsPlayerHandcuffed() then
  -- Block an action for the local cuffed player
end

IsPlayerHandcuffed

server

Checks whether a specific player is currently handcuffed by Server Creator’s built-in permission actions.

İmza

Lua
exports['DS-ServerCreator']:IsPlayerHandcuffed(playerId)

Parametreler

AdTipAçıklama
playerIdnumberThe player’s server ID.

Döndürür

boolean

true while the player is handcuffed, otherwise false.

Örnek

Lua
if exports['DS-ServerCreator']:IsPlayerHandcuffed(targetId) then
  print('The player is handcuffed')
end

Doorlocks

GetDoorState

server

Reads the authoritative live state of a built-in Server Creator doorlock.

İmza

Lua
exports['DS-ServerCreator']:GetDoorState(reference)

Parametreler

AdTipAçıklama
referencenumber | stringThe numeric database ID or the stable door name configured in the panel.

Döndürür

string | nil, string?

locked or unlocked. If the door does not exist, returns nil followed by door_not_found.

Örnek

Lua
local state, errorCode = exports['DS-ServerCreator']:GetDoorState('bank_vault')
if state == 'locked' then
  print('The vault is locked')
end

SetDoorState

server

Sets a door’s live state, synchronizes every client, fires the configured toggle hook, and arms autolock when applicable.

İmza

Lua
exports['DS-ServerCreator']:SetDoorState(reference, newState)

Parametreler

AdTipAçıklama
referencenumber | stringThe numeric database ID or the stable door name configured in the panel.
newStatestringThe new state: locked or unlocked.

Döndürür

boolean, string

A success boolean followed by the resulting state, or an error code on failure.

Örnek

Lua
local success, stateOrError = exports['DS-ServerCreator']:SetDoorState('bank_vault', 'unlocked')

ToggleDoor

server

Switches a door between locked and unlocked using the same authoritative synchronization as normal interactions.

İmza

Lua
exports['DS-ServerCreator']:ToggleDoor(reference)

Parametreler

AdTipAçıklama
referencenumber | stringThe numeric database ID or the stable door name configured in the panel.

Döndürür

boolean, string

A success boolean followed by the resulting state, or an error code on failure.

Örnek

Lua
local success, stateOrError = exports['DS-ServerCreator']:ToggleDoor('bank_vault')

Multijob

GetPlayerJobs

server

Returns every job held by a player, enriched with job and grade labels. Offline lookups are supported when you pass an identifier.

İmza

Lua
exports['DS-ServerCreator']:GetPlayerJobs(player)

Parametreler

AdTipAçıklama
playernumber | stringAn online player server ID, or a framework identifier for an offline lookup.

Döndürür

table

An array containing job_name, job_grade, is_active, job_label, and grade_label.

Örnek

Lua
local jobs = exports['DS-ServerCreator']:GetPlayerJobs(source)
for _, job in ipairs(jobs) do
  print(job.job_name, job.job_grade, job.is_active)
end

HasPlayerJob

server

Checks whether a player holds a job, optionally requiring a minimum grade.

İmza

Lua
exports['DS-ServerCreator']:HasPlayerJob(player, jobName, minimumGrade)

Parametreler

AdTipAçıklama
playernumber | stringAn online player server ID, or a framework identifier for an offline lookup.
jobNamestringThe internal job name, for example police.
minimumGrade?numberOptional minimum grade. Omit it to accept any grade for the job.

Döndürür

boolean

true when the player holds the requested job and meets the grade requirement.

Örnek

Lua
if exports['DS-ServerCreator']:HasPlayerJob(source, 'police', 2) then
  -- The player holds police grade 2 or higher
end

Robberies

GetRobberies

server

Returns all robbery definitions using the same client-safe schema sent to regular players.

İmza

Lua
exports['DS-ServerCreator']:GetRobberies()

Döndürür

table

An array of sanitized robbery definitions, including public steps, markers, blips, and sounds.

Örnek

Lua
local robberies = exports['DS-ServerCreator']:GetRobberies()
for _, robbery in ipairs(robberies) do
  print(robbery.id, robbery.name, robbery.enabled)
end

IsRobberyActive

server

Checks whether a robbery currently has an active runtime session.

İmza

Lua
exports['DS-ServerCreator']:IsRobberyActive(robberyId)

Parametreler

AdTipAçıklama
robberyIdnumberThe numeric robbery ID shown in the Server Creator panel.

Döndürür

boolean

true while the robbery is reserved or in progress, otherwise false.

Örnek

Lua
if exports['DS-ServerCreator']:IsRobberyActive(1) then
  print('Robbery #1 is in progress')
end

GetRobberyState

server

Returns the public live state of one robbery, including its state, current step, participant count, looted props, and remaining cooldown.

İmza

Lua
exports['DS-ServerCreator']:GetRobberyState(robberyId)

Parametreler

AdTipAçıklama
robberyIdnumberThe numeric robbery ID shown in the Server Creator panel.

Döndürür

table | nil

The live-state table, or nil when the robbery ID does not exist.

Örnek

Lua
local state = exports['DS-ServerCreator']:GetRobberyState(1)
if state then
  print(state.state, state.currentStep, state.cooldownRemaining)
end
Sensitive data stays private
GetRobberies 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.

Hâlâ takıldın mı?

Discord'umuzdan bir ticket aç, sana yardım edelim.

Discord'a katıl →