πŸ“–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