๐Exports & Usage
Dynyx Prison includes a set of exports that let developers interact with the system from other scripts. These exports allow jail logic, sentence modification, community service, and UI actions to be t
๐ฅ๏ธ Server Exports
These exports should be used from server-side scripts only.
๐ AddPrisonerExternally Jails a player and adds them to the prison system.
exports['dynyx_prison']:AddPrisonerExternally(serverId, sentence, charges, lifer, serviceType, previousSentence, fine)
Parameters:
serverId
(number) โ Playerโs server IDsentence
(number) โ Sentence length in monthscharges
(table/string) โ List or string of chargeslifer
(boolean) โ Whether the player is a liferserviceType
(string) โ"prison"
or"community_service"
previousSentence
(number, optional) โ For sentence stackingfine
(number, optional) โ Optional fine to apply
๐ ReleasePrisonerExternally Releases a prisoner or marks them as escaped.
exports['dynyx_prison']:ReleasePrisonerExternally(citizenid, jailbreak)
Parameters:
citizenid
(string) โ Playerโs unique identifierjailbreak
(boolean) โtrue
if escaped,false
if released normally
โ๏ธ ModifyPrisonerSentenceExternally Sets a new sentence time for a prisoner.
exports['dynyx_prison']:ModifyPrisonerSentenceExternally(citizenid, newTime)
Parameters:
citizenid
(string) โ Playerโs unique identifiernewTime
(number) โ New sentence time in months
๐ GetRemainingPrisonSentence Returns the current time remaining for a prisoner.
local time = exports['dynyx_prison']:GetRemainingPrisonSentence(citizenid)
Returns:
(number) Time remaining in months
0
if prisoner not found
โ IsPlayerJailed Checks if a player is currently serving a prison sentence.
local jailed = exports['dynyx_prison']:IsPlayerJailed(citizenid)
Returns:
(boolean)
true
if jailed,false
if not
๐ ๏ธ IsPlayerCommunityService Checks if a player is currently serving community service.
local comserv = exports['dynyx_prison']:IsPlayerCommunityService(citizenid)
Returns:
(boolean)
true
if serving community service,false
if not
๐จ IsPlayerEscaped (new) Checks if a player has escaped from prison.
local escaped = exports['dynyx_prison']:IsPlayerEscaped(citizenid)
Returns:
(boolean)
true
if escaped,false
if not
๐งโ๐ป Client Exports
These can be used from client-side scripts.
๐ OpenPrisonManageUI Opens the prison staff UI to view or manage prisoners.
exports['dynyx_prison']:OpenPrisonManageUI()
Requires the player to have a valid staff job.
๐จ OpenPrisonJobsUI Opens the inmate job selection UI.
exports['dynyx_prison']:OpenPrisonJobsUI()
๐ก Tips
You can use these in custom commands, MDTs, police scripts, admin menus, or integrated job systems.
All server-side exports use live data โ no need to restart the script after changes.
Last updated