๐Ÿ“–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 ID

  • sentence (number) โ€“ Sentence length in months

  • charges (table/string) โ€“ List or string of charges

  • lifer (boolean) โ€“ Whether the player is a lifer

  • serviceType (string) โ€“ "prison" or "community_service"

  • previousSentence (number, optional) โ€“ For sentence stacking

  • fine (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 identifier

  • jailbreak (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 identifier

  • newTime (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